Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible lock held too long issue in connection pool being threads +1 #214

Open
morgo opened this issue Oct 11, 2023 · 0 comments
Open

Possible lock held too long issue in connection pool being threads +1 #214

morgo opened this issue Oct 11, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@morgo
Copy link
Collaborator

morgo commented Oct 11, 2023

There is a possible race in acquiring locks the connection pool to threads +1:

  • The checksum acquires a LOCKS TABLES .. READ to start the RR connections for checksumming (1 connection)
  • The checkpoint thread starts, to update the checkpoint table (1 connection)
  • The checksum RR threads are opened (N threads connections; the last one waits on the checkpoint before it can start).
  • The checkpoint thread finishes.

I don't think this is much more than a very brief stall, but from a design perspective we should be acquiring and releasing locks as soon as possible without contention. So we may want to consider either:

  • A separate pool that is unrestricted for admin commands.
  • Using threads +2 for the pool size.

I'm yet to prove this in production. It was just a thought while inspecting the code.

@morgo morgo added the bug Something isn't working label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant