-
Notifications
You must be signed in to change notification settings - Fork 38
hrana: add diagnostics for connections #729
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small thing, otherwise LGTM.
We should go over that in the future and design a way to have diagnostic probes that don't couple unrelated modules too much
@psarna, can you rebase maybe? |
This commit adds a /v2/diagnostics endpoint which prints various information about current hrana-over-http connections. Draft, because the diagnostics are currently in a very debuggy format, and I'm figuring out if we can make it more human-readable. Still, they're enough to determine if something is holding a lock via an abandoned hrana-over-http stream. Example: ``` $ curl -s http://localhost:8080/v2/diagnostics | jq [ "expired", "expired", "expired", "expired", "expired", "(conn: Mutex { data: <locked> }, timeout_ms: 872, stolen: false)", "(conn: Mutex { data: <locked> }, timeout_ms: 0, stolen: true)" ] ```
Co-authored-by: ad hoc <postma.marin@protonmail.com>
This PR should have absolutely 0 to do with with bottomless, and yet I see bottomless test failures, that always pass for me locally. Maybe we have some kind of regression, let me investigate |
Oh wait, now they failed for me locally too, good |
@@ -199,6 +201,9 @@ unsafe impl WalHook for ReplicationLoggerHook { | |||
"Ignoring a checkpoint request weaker than TRUNCATE: {}", | |||
emode | |||
); | |||
if emode == SQLITE_CHECKPOINT_PASSIVE { | |||
return SQLITE_OK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow, that's leftovers from my early tests, it should not be there at all
This commit adds a
/v1/diagnostics
admin endpoint which prints various information about current hrana-over-http connections.Draft, because the diagnostics are currently in a very debuggy format, and I'm figuring out if we can make it more human-readable. Still, they're enough to determine if something is holding a lock via an abandoned hrana-over-http stream.
Example: