iteration-cli 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,13 +2,12 @@ import http from "node:http";
2
2
  import https from "node:https";
3
3
  const MAX_RESPONSE_BYTES = 1024 * 1024;
4
4
  const NULL_BODY_STATUSES = new Set([101, 103, 204, 205, 304]);
5
- // Node's fetch can negotiate HTTP/2 and, after a timed-out request breaks the
6
- // TLS connection, keep handing every later request the destroyed session until
7
- // the process restarts. The collector runs for days, so it uses HTTP/1.1
8
- // connections that are discarded when they fail.
5
+ // Reused connections failed uploads in production: Node's HTTP/2 fetch kept a
6
+ // destroyed session, and kept-alive sockets timed out on ~40 s server waits.
7
+ // See docs/architecture/trace-ingestion.md.
9
8
  const agents = {
10
- "http:": new http.Agent({ keepAlive: true, maxSockets: 2 }),
11
- "https:": new https.Agent({ keepAlive: true, maxSockets: 2 }),
9
+ "http:": new http.Agent({ keepAlive: false }),
10
+ "https:": new https.Agent({ keepAlive: false }),
12
11
  };
13
12
  export const collectorFetch = (input, init = {}) => {
14
13
  const url = new URL(input);
package/dist/collector.js CHANGED
@@ -12,6 +12,10 @@ const MAX_UPLOAD_BYTES = 3 * 1024 * 1024;
12
12
  const MAX_EVENT_BYTES = MAX_UPLOAD_BYTES - 1024;
13
13
  const MAX_UPLOADS_PER_TICK = 5;
14
14
  const MAX_REQUEST_BYTES = 4 * 1024 * 1024;
15
+ // Production stores some batches in about 40 seconds. Abandoning a request
16
+ // earlier does not stop the server, so the retry only waits behind it and the
17
+ // collector reports a failure for work that succeeded.
18
+ const UPLOAD_TIMEOUT_MS = 90_000;
15
19
  // A tick can queue up to MAX_SCAN_BYTES_PER_TICK of new events, so scanning
16
20
  // pauses well below the outbox capacity and resumes once uploads drain it.
17
21
  const SCAN_PAUSE_OUTBOX_BYTES = 32 * 1024 * 1024;
@@ -182,8 +186,8 @@ async function uploadPendingOnce(config, paths, fetcher = collectorFetch, signal
182
186
  },
183
187
  body,
184
188
  signal: signal
185
- ? AbortSignal.any([signal, AbortSignal.timeout(15_000)])
186
- : AbortSignal.timeout(15_000),
189
+ ? AbortSignal.any([signal, AbortSignal.timeout(UPLOAD_TIMEOUT_MS)])
190
+ : AbortSignal.timeout(UPLOAD_TIMEOUT_MS),
187
191
  });
188
192
  }
189
193
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iteration-cli",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",