A gentle deadlock monitor - #2262
Closed
aredridel wants to merge 10 commits into
Closed
Conversation
- connect_timeout: max time to establish S3 connection, configurable with LIBSQL_BOTTOMLESS_S3_CONNECT_TIMEOUT_SECS (default 5s) - read_timeout: max time to wait for first byte of response, configurable with LIBSQL_BOTTOMLESS_S3_READ_TIMEOUT_SECS (default 5s) - No operation timeout, allowing retries to continue indefinitely - Unit test: verifies connect_timeout and read_timeout are applied to AWS SDK config Integration tests: - verify that the read_timeout fires when the server hangs - verify the S3 connect timeout using a blackhole IP - verify behavior when there is a timeout during initial replication
…etes Moves default namespace creation (which triggers bottomless restore on primary and initial replication handshake on replica) to before any HTTP/Hrana/gRPC acceptors start serving. This ensures the database is fully initialized before clients can connect. The admin API begins accepting connections right away, allowing operators to inspect state during initialization and to allow the admin port to act as a startup liveness check, and letting the main ports act as a readiness check. Also fixes test flakiness by running the mock S3 server on a dedicated OS thread so it survives past individual test runtimes, and replacing all env-var-based Options configuration with explicit structs to eliminate cross-test env var races.
Tests panic with connection refused because they open a database connection before it is fully started. We add an HTTP-poll loop (matching the pattern used in replication.rs and other cluster tests) to wait for the replica's user API endpoint to become responsive before proceeding.
Add timeouts & defer listening until ready.
…eadlock The deadlock monitor panicked via sender.try_send(...).unwrap() on the second iteration after a single missed pong: the mpsc channel has capacity 1, so when the main runtime stalled (e.g. a slow S3 checkpoint upload) the previous Ping stayed queued and try_send returned Full, panicking instead of reporting the deadlock. The intended std::process::exit(1) was commented out, leaving the unwrap as the sole failure path. A single missed pong is a stall, not proof of deadlock — it can be a slow checkpoint, blocking I/O, or overload. Count consecutive misses and exit the process only after sustained unresponsiveness (3 misses), so a healthy-but-busy server survives a transient slow operation while a real deadlock still brings the process down for a supervisor restart.
Author
|
Whoops. Wrong repo. |
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.
No description provided.