Skip to content

Commit

Permalink
Fix #1271: reprecate LockFreePool in 2.18 (to be removed from 3.0) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 10, 2024
1 parent d3afc9e commit 9ab0c70
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
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
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
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

0 comments on commit 9ab0c70

Please sign in to comment.