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

PyroscopeAgent: stop method should stop/close Exporter as well #169

Open
REASY opened this issue Nov 21, 2024 · 0 comments
Open

PyroscopeAgent: stop method should stop/close Exporter as well #169

REASY opened this issue Nov 21, 2024 · 0 comments

Comments

@REASY
Copy link

REASY commented Nov 21, 2024

PyroscopeAgent: stop method should stop/close Exporter as well

Currently there is no way to stop daemon thread created in QueuedExporter.java. This is useful in case when one wants to have an app profiled dynamically without requiring restart. Imagine there is a long running app, I enable profiling for some amount of time, collect enough data and disable profiling. After some time I want to enable profiling again. Without stopping thread in QueuedExporter.java there will be many threads created and all waiting inside the loop in OverfillQueue.java

"Thread-174" - Thread t@742
   java.lang.Thread.State: WAITING
        at [email protected]/jdk.internal.misc.Unsafe.park(Native Method)
        - parking to wait for <778c4f25> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:341)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block(AbstractQueuedSynchronizer.java:506)
        at [email protected]/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3465)
        at [email protected]/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3436)
        at [email protected]/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1623)
        at app//io.pyroscope.javaagent.OverfillQueue.take(OverfillQueue.java:63)
        at app//io.pyroscope.javaagent.impl.QueuedExporter.exportLoop(QueuedExporter.java:29)
        at app//io.pyroscope.javaagent.impl.QueuedExporter$$Lambda$1176/0x00007fa690e15470.run(Unknown Source)
        at [email protected]/java.lang.Thread.run(Thread.java:833)

   Locked ownable synchronizers:
        - None
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

1 participant