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

Deprecate AbstractConnectionPool "callback" methods #5857

Closed
sbordet opened this issue Jan 5, 2021 · 3 comments · Fixed by #11542
Closed

Deprecate AbstractConnectionPool "callback" methods #5857

sbordet opened this issue Jan 5, 2021 · 3 comments · Fixed by #11542
Assignees

Comments

@sbordet
Copy link
Contributor

sbordet commented Jan 5, 2021

Jetty version
9.4.x

Description
AbstractConnectionPool has the following "callback" methods:

  • onCreated(Connection)
  • idle(Connection, boolean)
  • acquired(Connection)
  • released(Connection)
  • removed(Connection)

They were introduced as "callbacks" for subclasses to override, but since they are called "after the fact", the Connection status maybe already changed.

For example, when idle(Connection, boolean) is called, the Connection` may already be used by some other thread N times or already be closed.

Furthermore, ordering is not guaranteed so, it is possible for example that released(Connection) is called before acquired(Connection).

Primary user of these "callbacks" is LeakTrackingConnectionPool, but due to the problems above it's not that reliable.

This has also been reported in #2814 and also in #4949.

@github-actions
Copy link

github-actions bot commented Jan 6, 2022

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Jan 6, 2022
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label Jan 6, 2022
@github-actions
Copy link

github-actions bot commented Jan 7, 2023

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Jan 7, 2023
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label Jan 7, 2023
Copy link

github-actions bot commented Jan 8, 2024

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Jan 8, 2024
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label Jan 8, 2024
sbordet added a commit that referenced this issue Mar 21, 2024
Deprecated idle(), acquired(), released() for removal.
Renamed removed(), now deprecated, to onRemoved() to match with onCreated().
Kept onCreated() and onRemoved() as they are the only methods that are not racy.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet moved this to 🏗 In progress in Jetty 12.0.8 - FROZEN Mar 21, 2024
sbordet added a commit that referenced this issue Mar 22, 2024
…11542)

Deprecated idle(), acquired(), released() for removal.
Renamed removed(), now deprecated, to onRemoved() to match with onCreated().
Kept onCreated() and onRemoved() as they are the only methods that are not racy.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Jetty 12.0.8 - FROZEN Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant