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
feat: terminate data flow on transfer completion #3481
feat: terminate data flow on transfer completion #3481
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3481 +/- ##
==========================================
+ Coverage 72.08% 72.13% +0.05%
==========================================
Files 841 839 -2
Lines 16996 17036 +40
Branches 951 955 +4
==========================================
+ Hits 12251 12289 +38
- Misses 4341 4345 +4
+ Partials 404 402 -2
☔ View full report in Codecov by Sentry. |
91a6425
to
94909ca
Compare
5ebe8cd
to
1f25856
Compare
@ndr-brt It would be good to first add a DR outlining this new state and its uses. |
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 had a few questions regarding "terminating" vs "stopping".
- when we
terminate
, we send aTransferTerminationMessage
, but when westop
, we don't send anything. Is that on purpose? Shouldn't we notify the counter-party, that a transfer has been stopped? - conversely, when we "terminate", we don't invoke the dataflow manager, so theoretically there could still be an ongoing transfer, right?
- isn't "stopping" almost the same as "terminating", but with a "configurable" next state? Or rather: isn't terminating just stopping with a preconfigured next state?
If those questions are scoped too broadly, we can just merge the PR and discuss elsewhere
public void transitionStopping(String reason, TransferProcessStates subsequentState) { | ||
transition(STOPPING, STARTED); | ||
errorDetail = reason; | ||
privateProperties.put("stopping-subsequent-state", subsequentState); |
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.
nit: use a constant
@@ -91,6 +92,11 @@ public ServiceResult<Stream<TransferProcess>> query(QuerySpec query) { | |||
}); | |||
} | |||
|
|||
@Override | |||
public ServiceResult<Void> stop(StopTransferCommand command) { |
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.
to keep consistency with the other methods, this should probably also be @NotNull
1f25856
to
6267be7
Compare
@paullatzelsperger , yes, sorry, I discussed with @jimmarino after then and decided to avoid that STOPPING status, instead the data flow termination will be invoked before the transfer process termination. I updated the PR accordingly, now it's ready to be reviewed. |
6267be7
to
7544346
Compare
37919df
to
f8a509f
Compare
f8a509f
to
960e5a2
Compare
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.
Great stuff!
What this PR changes/adds
Ensures that the data flow gets terminated when the PolicyMonitor detects a no more valid policy.
Why it does that
policy monitor
Further notes
DataFlowController
can be terminated through theterminate
methodclose
on theDataSource
Linked Issue(s)
Closes #3453
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.