Skip to content

Commit b52c453

Browse files
asdf
1 parent 5d51f1e commit b52c453

File tree

5 files changed

+44
-28
lines changed

5 files changed

+44
-28
lines changed

.evergreen/config.in.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,6 @@ functions:
141141
add_expansions_to_env: true
142142
args:
143143
- .evergreen/run-serverless-tests.sh
144-
- command: s3.put
145-
params:
146-
aws_key: ${aws_key}
147-
aws_secret: ${aws_secret}
148-
local_file: src/connection-logs.txt
149-
optional: true
150-
# Upload the coverage report for all tasks in a single build to the same directory.
151-
# TODO NODE-4707 - change upload directory to ${UPLOAD_BUCKET}
152-
# This change will require changing the `download and merge coverage` func as well
153-
remote_file: mongo-node-driver/${revision}/${version_id}/${build_variant}/${task_name}/connection-logs.txt
154-
bucket: mciuploads
155-
permissions: public-read
156-
content_type: text/plain
157-
display_name: "Connection Logs"
158144

159145
"start-load-balancer":
160146
- command: shell.exec
@@ -1016,6 +1002,20 @@ task_groups:
10161002
- .evergreen/setup-serverless.sh
10171003

10181004
teardown_group:
1005+
- command: s3.put
1006+
params:
1007+
aws_key: ${aws_key}
1008+
aws_secret: ${aws_secret}
1009+
local_file: src/connection-logs.txt
1010+
optional: true
1011+
# Upload the coverage report for all tasks in a single build to the same directory.
1012+
# TODO NODE-4707 - change upload directory to ${UPLOAD_BUCKET}
1013+
# This change will require changing the `download and merge coverage` func as well
1014+
remote_file: mongo-node-driver/${revision}/${version_id}/${build_variant}/${task_name}/connection-logs.txt
1015+
bucket: mciuploads
1016+
permissions: public-read
1017+
content_type: text/plain
1018+
display_name: "Connection Logs"
10191019
- func: "upload test results"
10201020
- command: subprocess.exec
10211021
params:

.evergreen/config.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,6 @@ functions:
110110
add_expansions_to_env: true
111111
args:
112112
- .evergreen/run-serverless-tests.sh
113-
- command: s3.put
114-
params:
115-
aws_key: ${aws_key}
116-
aws_secret: ${aws_secret}
117-
local_file: src/connection-logs.txt
118-
optional: true
119-
remote_file: mongo-node-driver/${revision}/${version_id}/${build_variant}/${task_name}/connection-logs.txt
120-
bucket: mciuploads
121-
permissions: public-read
122-
content_type: text/plain
123-
display_name: Connection Logs
124113
start-load-balancer:
125114
- command: shell.exec
126115
params:
@@ -2896,6 +2885,17 @@ task_groups:
28962885
args:
28972886
- .evergreen/setup-serverless.sh
28982887
teardown_group:
2888+
- command: s3.put
2889+
params:
2890+
aws_key: ${aws_key}
2891+
aws_secret: ${aws_secret}
2892+
local_file: src/connection-logs.txt
2893+
optional: true
2894+
remote_file: mongo-node-driver/${revision}/${version_id}/${build_variant}/${task_name}/connection-logs.txt
2895+
bucket: mciuploads
2896+
permissions: public-read
2897+
content_type: text/plain
2898+
display_name: Connection Logs
28992899
- func: upload test results
29002900
- command: subprocess.exec
29012901
params:

src/cmap/connect.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,12 @@ export async function makeSocket(options: MakeConnectionOptions): Promise<Stream
391391
socket
392392
.once(connectEvent, () => resolve(socket))
393393
.once('error', cause =>
394-
reject(new MongoNetworkError(MongoError.buildErrorMessage(cause), { cause }))
394+
reject(
395+
new MongoNetworkError(
396+
MongoError.buildErrorMessage(cause) + '- error encountered while establishing socket',
397+
{ cause }
398+
)
399+
)
395400
)
396401
.once('timeout', () => {
397402
reject(
@@ -489,7 +494,10 @@ async function makeSocks5Connection(options: MakeConnectionOptions): Promise<Str
489494
});
490495
existingSocket = connection.socket;
491496
} catch (cause) {
492-
throw new MongoNetworkError(MongoError.buildErrorMessage(cause), { cause });
497+
throw new MongoNetworkError(
498+
MongoError.buildErrorMessage(cause) + '- during socks5 proxy establishment',
499+
{ cause }
500+
);
493501
}
494502

495503
// Finally, now treat the resulting duplex stream as the

src/error.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Document } from './bson';
2+
import { write } from './cmap/connection';
23
import {
34
type ClientBulkWriteError,
45
type ClientBulkWriteResult
@@ -1045,8 +1046,15 @@ export class MongoNetworkError extends MongoError {
10451046
* @public
10461047
**/
10471048
constructor(message: string, options?: MongoNetworkErrorOptions) {
1049+
message = message + `(timestamp = ${new Date().toISOString()})`;
10481050
super(message, { cause: options?.cause });
10491051
this.beforeHandshake = !!options?.beforeHandshake;
1052+
1053+
write({
1054+
event: 'network error',
1055+
message,
1056+
error: options?.cause
1057+
});
10501058
}
10511059

10521060
override get name(): string {

test/tools/runner/hooks/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const filters: Filter[] = [];
4848

4949
let initializedFilters = false;
5050

51-
process.env.IP = spawnSync('curl ifconfig.me', { encoding: 'utf-8' }).stdout;
51+
process.env.IP = spawnSync('curl', ['ifconfig.me'], { encoding: 'utf-8' }).stdout;
5252

5353
async function initializeFilters(client): Promise<Record<string, any>> {
5454
if (initializedFilters) {

0 commit comments

Comments
 (0)