Re: Exceptional behavior of parallel stream

2016-08-23 Thread Edward Harned
An enhancement issue is nice, but what can you really do? The reason the framework cannot handle exceptions in related threads is because the framework doesn’t have a central thread management facility. It spits out threads like the Executor Service it inherits without regard for controlling those

Re: Exceptional behavior of parallel stream

2016-08-23 Thread Paul Sandoz
Hi Tagir, After some discussion with Doug i logged an issue: https://bugs.openjdk.java.net/browse/JDK-8164690 but as of yet undecided whether we should do anything about it at the level of ForkJoinTask or specific to Stream (or even Concurre

Re: Exceptional behavior of parallel stream

2016-08-18 Thread Paul Sandoz
> On 18 Aug 2016, at 03:54, Doug Lea wrote: > > On 08/17/2016 09:01 AM, Tagir F. Valeev wrote: >> Hello! >> >> I found no information in Stream API documentation on how it behaves >> in case if exception occurs during the stream processing. While it's >> quite evident for sequential stream (str

Re: Exceptional behavior of parallel stream

2016-08-18 Thread Tagir F. Valeev
Hello, Doug! Thank you for your response. DL> In your example, you can witness the delayed termination of other threads DL> upon exception in another because you add side-effecting operations DL> (here, just printing). Avoiding all this would force sequential processing. DL> But if the supplied

Re: Exceptional behavior of parallel stream

2016-08-18 Thread Doug Lea
On 08/17/2016 09:01 AM, Tagir F. Valeev wrote: Hello! I found no information in Stream API documentation on how it behaves in case if exception occurs during the stream processing. While it's quite evident for sequential stream (stream processing is terminated and exception is propagated to the

Fork/Join exceptional completion can return before all tasks have finished executing Re: Exceptional behavior of parallel stream

2016-08-17 Thread Paul Sandoz
Hi Tagir, Hmm… we certainly ensure that any short-circuiting computation will wait until all the computation is complete (tasks still running whose results will be thrown away have to complete before the terminal operation returns). In that sprit we should be consistent when exceptions are thro

Exceptional behavior of parallel stream

2016-08-17 Thread Tagir F. Valeev
Hello! I found no information in Stream API documentation on how it behaves in case if exception occurs during the stream processing. While it's quite evident for sequential stream (stream processing is terminated and exception is propagated to the caller as is), the behavior for parallel streams