<div dir="ltr">Hi Loom experts,<div><br></div><div>I was reading the <a href="https://github.com/openjdk/loom/blob/fibers/src/java.base/share/classes/java/util/stream/Gatherers.java">mapConcurrent() </a>source code yesterday and started to wonder what the behavior is when the thread running the gatherer is being interrupted while waiting.</div><div><br></div><div>IIRC, it seems like interruption would have no effect until all elements have been "integrated" and the code starts to run the finisher.</div><div><br></div><div>And when the finisher calls Future.get() on the first pending Future in the window, it will throw InterruptedException, which will be caught, re-interruptĀ the thread, and just *<b>silently truncate the result*</b>?</div><div><br></div><div>Is this the intended behavior? It means that if I'm looking at: Stream.of(1, 2, 3).gather(mapConcurrent(i -> i * 2)).toList(), the result can be any of [2], [2, 4] or [2, 4, 6], if there has been an interruption. And if there is other blockingĀ call after this line the code won't be able to know that the result has been silently truncated.</div><div><br></div><div>I don't see unit tests to cover interrupted exception so I'd stand corrected if I misread.</div><div><br></div><div>(I was curious as clearly that mapConcurrent() has no way to propagate InterruptedException).</div><div><br></div><div>This is my first email in this mailing list so apologies for inappropriate etiquette.</div><div><br></div><div>Happy Holidays!</div><div><br></div><div>Ben Yu,</div></div>