-
Notifications
You must be signed in to change notification settings - Fork 465
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
[WFCORE-6739] Allow ordering of ServerActivity execution by registerin… #5884
Conversation
6e0b22a
to
804b199
Compare
Core -> Full Integration Build 13523 outcome was FAILURE using a merge of 804b199 Failed tests
|
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.
I'm not sure why this is a DRAFT PR :-) It looks super good to me.
I just left a comment in the code.
Thank you very much @bstansberry for taking care of this
@@ -75,20 +81,32 @@ public synchronized void suspend(long timeoutMillis) { | |||
for(OperationListener listener: new ArrayList<>(operationListeners)) { | |||
listener.suspendStarted(); | |||
} | |||
outstandingCount = activities.size(); | |||
if (outstandingCount == 0) { | |||
groupsCount = activities.size(); |
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.
Shouldn't this be
groupsCount = activities.size(); | |
// Work out the number of ServerActivity implementations | |
activities.forEach((ranking,executionGroup) -> groupsCount =+ executionGroup.size()); |
Or, we could also add a groupsCount++
in registerActivity(ServerActivity)
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.
I don't think so. This var is meant to track the number of groups, not the number of activities. When each group completes preSuspend work it signals preSuspendGroupCallBack. When preSuspendGroupCallBack get groupsCount signals, it proceeds with the 'suspend' phase.
I should probably rename the 'activities' field to 'activitiesByGroup'.
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.
Yep, I see it now. Sorry for the noise.
Thanks for the review, @jmfinelli. It's draft for a couple reasons. :-) The biggest is that we're doing this to meet your use case, so before having other folks waste time looking at it, I wanted to make sure you thought it would. When we talked I thought we understood each other and something like this should solve your problem, but maybe I misunderstood or you thought more and don't think it will help etc. Sounds like it's ok though, so that's good. The other is that I should write a unit test. This works fine it that it doesn't break existing tests but that doesn't prove it actually works. :) Looking at SuspendController it seems very unit-testable, and the basic behavior that needs testing is straightforward (activities are invoked in the expected order regardless of the order of calls to registerActivity). |
Yep, it look super good to me and it reflects exactly what we talked about during the meeting :-) I think this is the last piece of the puzzle 🥳 I also declared a dependency in the proposal. |
…g them in distinct, ordered, 'execution groups'
@jmfinelli I added the test and moved this out of draft state. |
Thanks @jmfinelli |
…g them in distinct, ordered, 'execution groups'
https://issues.redhat.com/browse/WFCORE-6739
This is a draft pending further discussion, particularly of how suitable this is for the transaction subsystem's implementation of https://issues.redhat.com/browse/WFLY-17742.
@jmfinelli FYI.