Skip to content
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

Thread Issues #85

Open
VinceBezzina opened this issue Sep 29, 2023 · 3 comments
Open

Thread Issues #85

VinceBezzina opened this issue Sep 29, 2023 · 3 comments

Comments

@VinceBezzina
Copy link

Is it possible that ExpiringMap is not 100% Thread safe.

Name: ExpiringMap-Listener-2322
State: BLOCKED on Monitoring.LogMonitor.LogMonitorStream@108d2eca owned by: ajp-nio-192.168.62.11-8009-exec-11
Total blocked: 1 Total waited: 0

Stack trace:
java.io.PrintStream.println(PrintStream.java:805)
Vinatra.XXXExpirationListener.expired(XXXExpirationListener.java:41)
Vinatra.XXXExpirationListener.expired(XXXExpirationListener.java:15)
net.jodah.expiringmap.ExpiringMap$4.run(ExpiringMap.java:1220)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

We had a run off with thousands of threads created and blocking. Here is a sample of the thread. Outside seeing ExpiringMap in the thread. there a system.out.println() in XXXExpirationListener and these system.out.println() are handled by a thread with a custom Log Manager.

@jhalterman
Copy link
Owner

It looks like the thread is blocked on something that's happening inside your ExpirationListener. Is your expiration listener using some logging code that locks internally, such as on Monitoring.LogMonitor.LogMonitorStream? There may be a deadlock there.

@VinceBezzina
Copy link
Author

VinceBezzina commented Sep 29, 2023 via email

@jhalterman
Copy link
Owner

It seems like something is taking a lock on LogMonitorStream, which leads to the deadlock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants