fix(telemetry): replace fire-and-forget uvx with bounded queue-based … - #28
Open
caihe-ch wants to merge 1 commit into
Open
fix(telemetry): replace fire-and-forget uvx with bounded queue-based …#28caihe-ch wants to merge 1 commit into
caihe-ch wants to merge 1 commit into
Conversation
…upload The telemetry hooks spawned one `uvx alibabacloud.mcp-proxy@latest plugin-telemetry` process per event with no concurrency limit, timeout, or orphan reaping. Each uvx resolved @latest on every invocation and was detached via `( ... & )` + `disown`, causing processes to reparent to PID 1. Under sustained load this accumulated thousands of orphan processes, exhausting inodes and disk via UV cache proliferation. Replace the fire-and-forget pattern with a queue-based bounded worker: - telemetry_enqueue.py: hook scripts write event args as JSON to a per-client queue directory, then start the worker if not running - telemetry_worker.py: single-instance worker (flock), uses fixed venv with pinned package version instead of uvx @latest, hard timeout per upload with process group kill (no orphans), finite retry with dead-letter logging, configurable queue size cap - Modified 3 shell scripts (post-tool-trace.sh, prompt-trace.sh, stop-turn-increment.sh) to pipe handler output to enqueue helper - Modified stop_handler.py _spawn_upload() to queue events instead of Popen fire-and-forget Applied consistently across alibabacloud-core, alibabacloud-spec-ops, and alibabacloud-ecs-ops plugins. Bumped core version to 1.0.34. Added 30 automated tests covering: off switch, queue operations, single-instance lock, retry/dead-letter, timeout, process cleanup, and code safety (no uvx @latest / disown remaining). Fixes: #50646
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…upload
The telemetry hooks spawned one
uvx alibabacloud.mcp-proxy@latest plugin-telemetryprocess per event with no concurrency limit, timeout, or orphan reaping. Each uvx resolved @latest on every invocation and was detached via( ... & )+disown, causing processes to reparent to PID 1. Under sustained load this accumulated thousands of orphan processes, exhausting inodes and disk via UV cache proliferation.Replace the fire-and-forget pattern with a queue-based bounded worker:
Applied consistently across alibabacloud-core, alibabacloud-spec-ops, and alibabacloud-ecs-ops plugins. Bumped core version to 1.0.34.
Added 30 automated tests covering: off switch, queue operations, single-instance lock, retry/dead-letter, timeout, process cleanup, and code safety (no uvx @latest / disown remaining).
Fixes: #50646
Description
Type of Change
Checklist
python3 tools/validate.pyBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.