Experiencing an issue with ScheduledExecutorService alongside VT
robert engels
rengels at ix.netcom.com
Sun Jul 21 14:10:58 UTC 2024
Hi. The code looks incorrect (although it is not complete so hard to tell).
The outer exception catch is releasing the semaphore even though it may have never acquired it.
Since the code is not complete, there is no way to validate what you are seeing.
I suggest trying to provide a standalone reproducible test case.
> On Jul 21, 2024, at 8:11 AM, Yuval Lombard <yuval.l at securithings.com> wrote:
>
> Hi Alan,
>
> Attaching the thread dump when the issue occurs (as a txt file)
>
> It might be useful
>
> On Sun, 21 Jul 2024 at 12:41, Yuval Lombard <yuval.l at securithings.com <mailto:yuval.l at securithings.com>> wrote:
> Hi Alan
>
> Thanks for replying!
>
> When the issue occurs the Log you mentioned is not being printed - it is as if (or maybe it is even what is really happening) the virtual thread is not being scheduled (by its internal scheduler)
> I to a thread dump by executing "kill -3 <pid>" and did not see the VT, will `java <pid> Thread.dump_to_file <file>` produce a more detailed view of the living threads?
>
> I will try to run the later EA build
>
> On Sun, 21 Jul 2024 at 11:14, Alan Bateman <Alan.Bateman at oracle.com <mailto:Alan.Bateman at oracle.com>> wrote:
> On 21/07/2024 08:05, Yuval Lombard wrote:
> > Hey team
> >
> > We are experiencing some weird halting issues when scheduling tasks
> > with ScheduledExecutorService and VT.
> >
> > We are observing some near deadlock issues / halting of executors
> > which we are not able to reproduce when using platform threads
> >
> > This is one example of a near deadlock situation, where for some
> > reason virtual threads are starting to execute a task, and not
> > reaching the finally block nor the catch Throwable block to release
> > the acquired semaphore permit, reaching to drained semaphore.
>
>
> Is "Scheduling .. task for device" logged? Did you take thread dump with
> `java <pid> Thread.dump_to_file <file>` and try to identify the virtual
> thread?
>
> One of the later mails mentions 23-loom+4-102 and not seeing JFR events.
> Can you re-run with the latest EA build (currently 24-loom+2-24) as that
> has changes for the JFR events that may provide some insight here.
>
> -Alan
>
>
> --
> Kind regards,
>
> Yuval Lombard
>
> Lead Software Engineer
>
> +972.50.548.0111
>
> yuval.l at securithings.com <mailto:yuval.l at securithings.com>
> <logo_black.png>
>
>
>
> --
> Kind regards,
>
> Yuval Lombard
>
> Lead Software Engineer
>
> +972.50.548.0111
>
> yuval.l at securithings.com <mailto:yuval.l at securithings.com>
> <logo_black.png>
>
> <thread_dump.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20240721/c31462c6/attachment.htm>
More information about the loom-dev
mailing list