-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IdleManager.watch
freezes forever
#732
Comments
From the stacktrace you are using virtual threads. JavaMail/JakartaMail uses synchronized blocks in the code which will pin the carrier thread. My understanding is if enough carrier threads get pinned the worker pool will get exhausted and there will be no workers to run the async tasks. I would make sure that IdleManager.watch is not called from a virtual thread and re-test this. There was an old abandon branch that Bill was working on but never merged: #404 |
@jmehrens thank you for the response. I think you are right that in this case this is what happens. I should have seen it but I was searching for pinned threads in the thread dump but for some reason the dump from |
IdleManager is a bit special in that it might be worth switching to ReentrantLock. Looks trivial to do and class is marked experimental so compatibility change is not a big deal. Out of all of the classes here this one might good candidate to make virtual thread friendly. |
Well, users of the class don't/shouldn't care whether it uses |
I was just looking at code idlemanager code. You are right I need to look at the whole stack trace as there are other locks later on. I was thinking this might have been a candidate to fix but if it starts to get outside of idlemanager then this will |
In the end the whole thing might not be needed. The Loom guys already have a prototype for a fix of the P.S. Missed a "not" above. :) |
Describe the bug
IdleManager.watch
freezes foreverTo Reproduce
I don't have a reproduction, I just see it happening in production now and then. Here's the stack trace:
This freezes forever. I'm not sure why and what I can do about it.
Expected behavior
watch
to not freeze.Screenshots
N/A
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Mail server:
courier-imap
5.0.13Additional context
The library used is
com.sun.mail:jakarta.mail:1.6.7
.I don't understand why that would block. I see exactly 30 minutes after that in the
courier-imap
logs:imapd[1158]: TIMEOUT
- which is, I believe, the default IDLE timeout of the server.Is that an issue in the mail server or in Java Mail? What can I do about that? I've set
mail.imap.connectiontimeout
andmail.imap.writetimeout
to10_000
. I can't setmail.imap.timeout
as that seems to cause all kinds of deadlocks but that's another story.The text was updated successfully, but these errors were encountered: