+9
-3
lines changedFilter options
+9
-3
lines changed Original file line number Diff line number Diff line change
@@ -91,6 +91,7 @@
91
91
import java.util.concurrent.TimeUnit;
92
92
import java.util.concurrent.atomic.AtomicBoolean;
93
93
import java.util.concurrent.atomic.AtomicInteger;
94
+
import java.util.logging.Level;
94
95
import java.util.logging.Logger;
95
96
import java.util.stream.Collectors;
96
97
@@ -180,12 +181,17 @@ private LocalNode(
180
181
.ticker(ticker)
181
182
.removalListener((RemovalListener<SessionId, SessionSlot>) notification -> {
182
183
if (notification.getKey() != null && notification.getValue() != null) {
183
-
// Attempt to stop the session
184
184
SessionSlot slot = notification.getValue();
185
-
SessionId sessionId = notification.getKey();
185
+
SessionId id = notification.getKey();
186
+
if (notification.wasEvicted()) {
187
+
// Session is timing out, stopping it by sending a DELETE
188
+
LOG.log(Level.INFO, () -> String.format("Session id %s timed out, stopping...", id));
189
+
slot.execute(new HttpRequest(DELETE, "/session/" + id));
190
+
}
191
+
// Attempt to stop the session
186
192
slot.stop();
187
193
// Invalidate temp file system
188
-
this.tempFileSystems.invalidate(sessionId);
194
+
this.tempFileSystems.invalidate(id);
189
195
// Decrement pending sessions if Node is draining
190
196
if (this.isDraining()) {
191
197
int done = pendingSessions.decrementAndGet();
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4