Skip to content

Large amount of statement closes can hang the connection and possibly the cleaner thread #876

@mrotteveel

Description

@mrotteveel

Running the hibernate-orm tests using Jaybird 6.0.2 shows hangs in the cleaner thread closing the statement handle. If a lot of deferred actions are registered (e.g. a lot of statement leaks on a single connection), the registering thread will complete the deferred actions. It looks like under certain conditions, the protocol goes out of sync, and we're expecting more responses than there are, and this causes a hang when trying to read the operation code. If it is the cleaner thread that has to complete the deferred actions, it will hang, and this in turn will cause further attempts to use the connection to hang.

We'll need to do a number of things

  1. Have the cleaner thread not perform deferred actions and/or have the cleaner thread schedule the actual close on the common pool or something so it can't block the cleaner thread
  2. Maybe reduce the soTimeout while completing deferred actions?
  3. Investigate why the protocol goes out of sync (e.g. are there certain operations where we need to "cancel" a deferred action if a certain response was received for an earlier request)
  4. Are there codepaths that do not result in consuming deferred actions

Sub-issues

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions