Skip to content

fix: shut down cleanly after a failed startup - #91

Merged
danfimov merged 1 commit into
mainfrom
fix/shutdown-after-failed-startup
Nov 25, 2026
Merged

danfimov merged 1 commit into
mainfrom
fix/shutdown-after-failed-startup

Conversation

@danfimov

Copy link
Copy Markdown
Owner

The psycopg and psqlpy brokers create some attributes only in startup(). When startup() failed before that, shutdown() raised AttributeError. taskiq logs it as Exception found while shutting down broker; the stress harness hit it when a worker failed to start. shutdown() now skips what startup() did not create.

Test: startup fails before LISTEN is set up (all four drivers), and shutdown() must not raise.

Part of a stack; review and merge bottom-up. Stress-harness numbers are from a local run: 4 drivers, ~250–550 kicks per scenario, 2 worker processes per driver.

@danfimov
danfimov added this pull request to stack #93 November 25, 2026 19:38
@danfimov
danfimov force-pushed the fix/shutdown-after-failed-startup branch 3 times, most recently from 79d0e3a to 8b35b01 Compare November 25, 2026 22:14
@danfimov
danfimov force-pushed the fix/shutdown-after-failed-startup branch 5 times, most recently from 8214752 to d36626d Compare November 25, 2026 22:40
Base automatically changed from fix/schema-setup-privileges to main November 25, 2026 22:40
The psycopg and psqlpy brokers create some connection attributes only in
startup(). When startup() failed before that, shutdown() raised
AttributeError instead of closing what had been opened; taskiq logs it as
'Exception found while shutting down broker'.

shutdown() now skips what startup() did not create.
@danfimov
danfimov force-pushed the fix/shutdown-after-failed-startup branch from d36626d to 3b40484 Compare November 25, 2026 22:40
@danfimov danfimov self-assigned this Nov 25, 2026
@danfimov
danfimov merged commit 537f212 into main Nov 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant