Telegram: stop bot on polling teardown#31141
Merged
steipete merged 1 commit intoopenclaw:mainfrom Mar 2, 2026
Merged
Conversation
Contributor
Greptile SummaryThis PR fixes a polling teardown race condition where in-process restarts (SIGUSR1) could leave old Telegram long-poll internals alive, causing Confidence Score: 5/5
Last reviewed commit: 2ea44da |
2ea44da to
53f2035
Compare
Contributor
|
Landed via temp rebase onto main.
Thanks @liuxiaopai-ai! |
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.
Summary
Describe the problem and fix in 2–5 bullets:
getUpdates409 storms).runner.stop()andbot.stop()before continuing/restarting.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
getUpdatesconflicts.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Failing test/log before + passing after
Trace/log snippets
Screenshot/recording
Perf numbers (if relevant)
pnpm test src/telegram/monitor.test.tspnpm checkHuman Verification (required)
What you personally verified (not just CI), and how:
stop()when polling cycle exits.Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
src/telegram/monitor.tssrc/telegram/monitor.test.tsRisks and Mitigations
bot.stop()is wrapped fail-safe and does not crash teardown if already stopped.