Skip to content

Commit a5a2d85

Browse files
committed
GG-21630 [GG-20866] [IGNITE-11966] Fixed using AdaptiveLoadBalancingSpi without IgniteConfiguration.setIncludeEventTypes(EventType.EVT_TASK_FINISHED, EventType.EVT_TASK_FAILED) leads to memory leak - Fixed apache#6690. (apache#293)
(cherry picked from commit e2d6632)
1 parent 7bbf4d0 commit a5a2d85

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@
7272

7373
import static org.apache.ignite.events.EventType.EVTS_ALL;
7474
import static org.apache.ignite.events.EventType.EVTS_DISCOVERY_ALL;
75+
import static org.apache.ignite.events.EventType.EVT_JOB_MAPPED;
7576
import static org.apache.ignite.events.EventType.EVT_NODE_FAILED;
7677
import static org.apache.ignite.events.EventType.EVT_NODE_LEFT;
7778
import static org.apache.ignite.events.EventType.EVT_NODE_METRICS_UPDATED;
79+
import static org.apache.ignite.events.EventType.EVT_TASK_FAILED;
80+
import static org.apache.ignite.events.EventType.EVT_TASK_FINISHED;
7881
import static org.apache.ignite.internal.GridTopic.TOPIC_EVENT;
7982
import static org.apache.ignite.internal.events.DiscoveryCustomEvent.EVT_DISCOVERY_CUSTOM_EVT;
8083
import static org.apache.ignite.internal.managers.communication.GridIoPolicy.PUBLIC_POOL;
@@ -507,7 +510,16 @@ private boolean isHiddenEvent(int type) {
507510
* @return {@code true} if this is an internal event.
508511
*/
509512
private boolean isInternalEvent(int type) {
510-
return type == EVT_DISCOVERY_CUSTOM_EVT || F.contains(EVTS_DISCOVERY_ALL, type);
513+
switch (type) {
514+
case EVT_DISCOVERY_CUSTOM_EVT:
515+
case EVT_TASK_FINISHED:
516+
case EVT_TASK_FAILED:
517+
case EVT_JOB_MAPPED:
518+
return true;
519+
520+
default:
521+
return F.contains(EVTS_DISCOVERY_ALL, type);
522+
}
511523
}
512524

513525
/**

modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageRuntimeConfigurationSelfTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void testDisableWithIncludes() throws Exception {
135135
try {
136136
Ignite g = startGrid();
137137

138-
g.events().enableLocal(EVT_TASK_STARTED, EVT_TASK_FINISHED, EVT_JOB_STARTED);
138+
g.events().enableLocal(EVT_TASK_STARTED, EVT_JOB_STARTED);
139139

140140
final AtomicInteger cnt = new AtomicInteger();
141141

@@ -145,17 +145,17 @@ public void testDisableWithIncludes() throws Exception {
145145

146146
return true;
147147
}
148-
}, EVT_TASK_STARTED, EVT_TASK_FINISHED, EVT_JOB_STARTED);
148+
}, EVT_TASK_STARTED, EVT_JOB_STARTED);
149149

150150
g.compute().run(F.noop());
151151

152-
assertEquals(3, cnt.get());
152+
assertEquals(2, cnt.get());
153153

154-
g.events().disableLocal(EVT_TASK_STARTED, EVT_TASK_FINISHED, EVT_JOB_FAILED);
154+
g.events().disableLocal(EVT_TASK_STARTED, EVT_JOB_FAILED);
155155

156156
g.compute().run(F.noop());
157157

158-
assertEquals(4, cnt.get());
158+
assertEquals(3, cnt.get());
159159
}
160160
finally {
161161
stopAllGrids();

0 commit comments

Comments
 (0)