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

Fix #1271: reprecate LockFreePool in 2.18 (to be removed from 3.0) #1291

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ a pure JSON library.
to prevent use by downstream consumers
(requested by @seadbrane)
#1266: Change default recycler pool to `newConcurrentDequePool()` in 2.18
#1271: Deprecate `LockFreePool` implementation in 2.18 (remove from 3.0)
#1277: Add back Java 22 optimisation in FastDoubleParser

2.17.1 (04-May-2024)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.util.RecyclerPool.BoundedPoolBase;
import com.fasterxml.jackson.core.util.RecyclerPool.ConcurrentDequePoolBase;
import com.fasterxml.jackson.core.util.RecyclerPool.LockFreePoolBase;

/**
* Set of {@link RecyclerPool} implementations to be used by the default
Expand Down Expand Up @@ -74,7 +73,11 @@ public static RecyclerPool<BufferRecycler> newConcurrentDequePool() {
* Accessor for getting the shared/global {@link LockFreePool} instance.
*
* @return Globally shared instance of {@link LockFreePool}.
*
* @deprecated Since 2.18: use one of other implementations instead;
* see {@link LockFreePool} Javadocs for details
*/
@Deprecated // since 2.18
public static RecyclerPool<BufferRecycler> sharedLockFreePool() {
return LockFreePool.GLOBAL;
}
Expand All @@ -83,7 +86,11 @@ public static RecyclerPool<BufferRecycler> sharedLockFreePool() {
* Accessor for constructing a new, non-shared {@link LockFreePool} instance.
*
* @return Globally shared instance of {@link LockFreePool}.
*
* @deprecated Since 2.18: use one of other implementations instead;
* see {@link LockFreePool} Javadocs for details
*/
@Deprecated // since 2.18
public static RecyclerPool<BufferRecycler> newLockFreePool() {
return LockFreePool.construct();
}
Expand Down Expand Up @@ -204,8 +211,18 @@ protected Object readResolve() {
*<p>
* Pool is unbounded: see {@link RecyclerPool} for
* details on what this means.
*<p>
* NOTE: serious issues found with 2.17.0 lead to deprecation
* of this implementation -- basically it is possible to have
* unbalanced acquire/release success rate lead to excessive
* growth of pooled instances.
* See <a href="https://github.com/FasterXML/jackson-core/issues/1260">
* jackson-core#1260</a> for details.
*
* @deprecated Since 2.18: use other implementations instead
*/
public static class LockFreePool extends LockFreePoolBase<BufferRecycler>
@Deprecated
public static class LockFreePool extends RecyclerPool.LockFreePoolBase<BufferRecycler>
{
private static final long serialVersionUID = 1L;

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/fasterxml/jackson/core/util/RecyclerPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,17 @@ public boolean clear() {
* a lock free linked list for recycling instances.
* Pool is unbounded: see {@link RecyclerPool} for
* details on what this means.
*<p>
* NOTE: serious issues found with 2.17.0 lead to deprecation
* of this implementation -- basically it is possible to have
* unbalanced acquire/release success rate lead to excessive
* growth of pooled instances.
* See <a href="https://github.com/FasterXML/jackson-core/issues/1260">
* jackson-core#1260</a> for details.
*
* @deprecated Since 2.18: use other implementations
*/
@Deprecated // since 2.18
abstract class LockFreePoolBase<P extends WithPool<P>>
extends StatefulImplBase<P>
{
Expand Down