-
Bug
-
Resolution: Fixed
-
P3
-
21
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8312918 | 21.0.1 | Alan Bateman | P3 | Resolved | Fixed | b04 |
JDK-8312066 | 21 | Alan Bateman | P3 | Resolved | Fixed | b32 |
The following doesn't complete (shutdown) in a short period of time as expected (checked on MacOS/arm64)
for (int i = 0; i<10; i++) {
try (var stof = new StructuredTaskScope.ShutdownOnFailure("name", r -> Thread.ofPlatform().unstarted(r))) {
stof.fork(() -> {
Thread.sleep(Duration.ofMinutes(5));
return "result 2";
});
stof.fork(() -> {throw new RuntimeException("exception 1"); });
stof.fork(() -> {
Thread.sleep(Duration.ofMinutes(5));
return "result 3";
});
stof.join();
}
}
No problem seen if switching to Thread.ofVirtual() (and any number of iterations)
for (int i = 0; i<10; i++) {
try (var stof = new StructuredTaskScope.ShutdownOnFailure("name", r -> Thread.ofPlatform().unstarted(r))) {
stof.fork(() -> {
Thread.sleep(Duration.ofMinutes(5));
return "result 2";
});
stof.fork(() -> {throw new RuntimeException("exception 1"); });
stof.fork(() -> {
Thread.sleep(Duration.ofMinutes(5));
return "result 3";
});
stof.join();
}
}
No problem seen if switching to Thread.ofVirtual() (and any number of iterations)
- backported by
-
JDK-8312066 StructuredTaskScope.shutdown does not interrupt newly started threads
-
- Resolved
-
-
JDK-8312918 StructuredTaskScope.shutdown does not interrupt newly started threads
-
- Resolved
-
- links to
-
Commit openjdk/jdk21/281aee96
-
Commit openjdk/jdk/92a04e20
-
Review openjdk/jdk21/123
-
Review openjdk/jdk/14833
(1 links to)