-
Notifications
You must be signed in to change notification settings - Fork 34
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
Internal trackers APIs #369
Conversation
@avpotapov00 could you please have a look at this PR and check if it aligns with your vision for the parking tracker for stress strategy. |
src/jvm/main/org/jetbrains/kotlinx/lincheck/strategy/managed/ParkingTracker.kt
Outdated
Show resolved
Hide resolved
@ndkoval ready for review. |
@eupp, great, I will take a look at the PR. Meanwhile, could you please investigate why the build on Windows has failed? |
Looks like unrelated flakiness problem. I've re-run the build and it is green now. |
* | ||
* @param threadId the id of the thread to check for parking status. | ||
* @return true if the thread should continue waiting, | ||
* false if it was already unparked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it return false
if the execution has finished?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "execution has finished" do you mean "all other threads finished"?
At least in current implementation, ParkingTracker
does not have access to threads "finish status" info. Parking tracker only stores parked
boolean flags for each thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So can I merge this PR? @ndkoval
Hi @eupp, I've approved the PR. Thanks for extracting the logic and improving the code structure! I've left a minor comment -- please address it and merge the PR. |
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
This PR implements a refactoring to introduce separate internal event trackers API:
MonitorTracker
tracks monitor events (lock, unlock, wait, notify)ParkingTracker
tracks parking events (park, unpark)ObjectTracker
tracks new objects creation and changes in object graph topology.Different strategies can implement these tracker interfaces for their needs.
We need this refactoring for two features: