Repository navigation
fix(cli): delete dev endpoints when rp flash dev is stopped by a signal - #625
Open
justinwlin wants to merge 5 commits into
Open
justinwlin wants to merge 5 commits into
justinwlin wants to merge 5 commits into
Conversation
This was referenced Oct 19, 2026
A dev session started in the background from a non-interactive shell inherits SIGINT as ignored, so Python never raises KeyboardInterrupt, and SIGTERM has no handler. Either way the process stopped without its teardown and left the session's endpoints running and billing. A stop during a long entrypoint call also waited for that call indefinitely. Install SIGINT and SIGTERM handlers on the session loop. The first signal cancels the session, which runs teardown and deletes the endpoints. A second signal stops waiting for a running entrypoint. The entrypoint thread is a daemon and tolerates the loop closing under it.
…ignal a signal during teardown cancelled the deletes still pending, and a signal during endpoint creation dropped the id the platform had already assigned. teardown now ignores signals, and a cancelled create waits for its reply and records the endpoint so teardown deletes it.
justinwlin
force-pushed
the
fix/dev-signal-cleanup
branch
from
October 20, 2026 15:48
79f63fb to
0e88f57
Compare
justinwlin
marked this pull request as ready for review
October 20, 2026 15:48
KAJdev
approved these changes
Oct 20, 2026
This branch has not been deployed
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.
Flash → SDK 2.0 fix stack
PRs 1–9 are independent PRs off
main, and 10 is stacked on 9. Merge in this order. Hover a link for its status.mainpeft/accelerategets bundledrp flash devleaks endpoints when stopped by a signalvol.pathsays "not mounted" on deployed workersrunpod2.0.0rc2 with 1–6Stopping
rp flash devwith a signal left its endpoints running and billing. An agent's dev loop hits this every time: it starts the session in the background and stops it withkill.Cause
KeyboardInterrupthandler, and asyncio doesn't add its own, sokill -INTdoes nothing.runpod-flash cleaned up on
KeyboardInterruptin its CLI.Change
Testing
rp flash dev main.py < /dev/null &, then stop itmainkill -TERM✓ cleaning up 1 deletedkill -INTfrom a script (SIGINT ignored at start)KeyboardInterrupt)✓ cleaning up 1 deletedHow we tested and compared
rp flash devin the background from a non-interactive script, wait for the firstdone in, then send the signal. We checked the session log for the cleanup line and listed the account's endpoints afterward. We ran this before the review fixes and again on a build of all five PRs on the currentmain. Both runs cleaned up after TERM and after INT, with nodev-*endpoint left.main, the plugin's dev loop needed a wrapper that restored SIGINT before exec, because a plainkillleft the endpoint billing.pytest tests: 1484 passed, coverage 91.65%.Review (Codex, two rounds)
save_endpointlost the id the platform had already created_create_trackedshields the create, waits for the reply, and records the endpoint before re-raising.