-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Implement telemetry flush on mongosh shutdown in a way that does not add noticeable exit-time delay. End-of-session telemetry requires flushing, gzip+base64 cookie encoding, and sending an outgoing HTTP request, and we have previously seen cases where outgoing requests appeared to hang instead of finishing promptly. The implementation should ensure supported sessions can exit quickly even when telemetry delivery is slow or blocked, include a strict timeout for request completion, and keep failures silent. If needed, the solution can consider moving beacon sending out of the main process, but it must avoid increasing CPU cost for short-lived sessions.
Guardrails:
- Http requests must work with existing proxy configurations
- Existing global telemetry opt‑out mechanisms (e.g., environment variables / config flags) are respected.
- Telemetry emission has negligible impact on interactive latency:
- Non‑blocking sends; no long synchronous waits
- Worst case scenario: max 1 sec added to shutdown time, to wait for flushing
- Fire and forget and accept some data loss as per design
- Telemetry related failures never surface to customers.