Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit 485a9a4

Browse files
committed
JERSEY-2979: Removed immediate scope support from Jersey due to memory leak issues.
Change-Id: Ie10a4699080748022ad126a65bbe9fd6676d71e7
1 parent bf3b5fb commit 485a9a4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

core-common/src/main/java/org/glassfish/jersey/internal/inject/Injections.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ private static ServiceLocator _createLocator(final String name, final ServiceLoc
139139

140140
result.setNeutralContextClassLoader(false);
141141
ServiceLocatorUtilities.enablePerThreadScope(result);
142-
ServiceLocatorUtilities.enableImmediateScope(result);
142+
143+
// HK2 Immediate Scope is commented out due to JERSEY-2979 and other issues
144+
// ServiceLocatorUtilities.enableImmediateScope(result);
143145

144146
for (final Binder binder : binders) {
145147
bind(result, binder);

core-common/src/test/java/org/glassfish/jersey/internal/inject/InjectionsTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
import org.glassfish.hk2.api.Immediate;
5151
import org.glassfish.hk2.api.ServiceLocator;
5252
import org.glassfish.hk2.utilities.binding.AbstractBinder;
53+
54+
import org.junit.Ignore;
5355
import org.junit.Test;
5456

5557
/**
@@ -74,6 +76,8 @@ public class InjectionsTest {
7476
* @throws InterruptedException if awaiting on the latch is interrupted.
7577
*/
7678
@Test
79+
@Ignore("HK2 Immediate Scope is now disabled due to a memory leak issues with ImmediateThread (see JERSEY-2979) and some "
80+
+ "other problems which aren't publicly reported.")
7781
public void testHK2ImmediateAnnotation() throws InterruptedException {
7882
final CountDownLatch latch = new CountDownLatch(1);
7983

0 commit comments

Comments
 (0)