-
Notifications
You must be signed in to change notification settings - Fork 28
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
DSpot stops execution if number of iterations >= 4. Possible thread deadlock #711
Comments
This problems seems happens only with default PIT selector. It doesn't happen with JacocoCoverageSelector. |
It is not related to the JoinForkPool thread. Indeed, it is the thread pool-15-thread-1 the one is working while main thread is parked. I want to identify in code where this thread is invoked. |
Thank you very much for investigating this. Please, keep us update of your progress and do not hesitate if you have questions or need help :) |
According with Netbeans profiling there is a deadlock between main and ForkJoinPool thread workers, possibly because a parallel stream. I will try to identify the causing code. |
The problem lays in the TestRunner. I've got its code. There is a thread deadlock. Investigating |
Not clear if there is a deadlock, it just takes an enormous time to complete the tests when number of iterations is 4, and CPU is mostly idle. It tooks 42824149 ms to complete execution. I will further investigate. I will check that wait timeouts were not triggered. |
Thank you @jesus-gorronogoitia ! |
Hi @danglotb This is a quite tricky issue. After spending long time debugging and profiling DSpot behavior over DHell, I have (I think) located the issue in Dhell, but I have no idea why this is happening. I am reporting you so you can have an idea what is going on.
RunnableProcess waits for the process to be completed, and the main thread as well in submit.get() What is the problem: the forked JVM process never finishes, so the submit.get() is not returned, so we are blocked until the timeout (which is really high: 6001000ms) triggers. Why does the process never finish?
Why does this happens only when executed from DSpot? I have not idea. So the point is that this behavior seems to be caused by Dhell. However, I also observe the behavior that DSpot is being notified when all test cases have been executed (in EntryPoint) takes a lot of time, but it is not immediately notified when the tests execution is completed, as it should be. I will keep investigating. |
These thread are locked because another thread is executing the same HelloApp() code, it is in RUNNABLE state, but is not being executed, so it does not release the lock. I will investigate is not being executed despite it is in RUNNABLE state. |
Hi @danglotb I solved it!!!! |
Hello @jesus-gorronogoitia That's great! Thank you!
Cannot wait to see this pull request.
Remove everything that is not used anymore. In the worst case, we have the versioning in GitHub. Will you create a pull request on STAMP-project/testrunner? |
Hi @danglotb Proposed changes are in TestRunner component, not in DSpot, but to adopt them in DSpot I needed to update DSpot pom.xml to use the TestRunner 2.0.7-SNAPSHOT version. Hence, what should I proposed in my PR? Only changes in TestRunner and you promote them to Dspot updating the pom.xml? |
You can open both pull requests. However, maybe we can release WDYT? |
Hi @danglotb |
Characteristics
Description
Profiling DSpot execution with Netbeans profiler, I've noticed that DSpot CPU usage drops to 0 after few seconds when the number of iterations is set to a value of 4 or above (it works well with values 1..3).
So, I runned DSpot standalone with same configuration, getting it stuck in the same log point:
dhell.HelloAppTest: @BeforeClass - runOnceAtTheBeginning dhell.HelloAppTest: @AfterClass - runOnceAtTheEnd File saved to the following path: /home/yosu/Projects/STAMP/Git/dhell/target/dspot/observations.ser File saved to the following path: /home/yosu/Projects/STAMP/Git/dhell/target/dspot/TestListener.ser
CPU statistics show that DSpot CPU consumption goes to zero.
Inspecting DSpot source code I noticed it is using Java8 Parallel Stream in certain parts of code. This uses the default ForkJoinThread, which when requires a number of threads higher than the number of physical CPU execution thread, could eventually stuck into a deadlock. So, in my laptop (4 CPU execution threads), DSpot gets stuck when the number of iterations are 4 or above.
However, I don't remember that DSpot is using parallel stream to iterate over the requested iteration.
I will further investigate and report.
Steps to reproduce
Execute DSpot on DHell project using below CLI command.
Properties file
Default Dhell properties file.
Command Line / Options
Other files and URLs
Relationships
Help on issue template
Preview to follow the link or open file .github/ISSUE_DOC.md
The text was updated successfully, but these errors were encountered: