Skip to content

Conversation

@ndr-brt
Copy link
Member

@ndr-brt ndr-brt commented Jan 28, 2025

What this PR changes/adds

Apply transfer termination in asynchronous manner.

Why it does that

as stated in the related DR

Further notes

  • to distinguish when a termination has been requested by one party or the other another status TERMINATING_REQUESTED has been added (best name that came to mind 😅 ). For this status there will be no message dispatch, because the message was already sent from the counter party. If this proposal goes through I will update the documentation accordingly.
  • this PR does not focus on other async operations (like the suspension), they will be tackled by separated PRs

Who will sponsor this feature?

Please @-mention the committer that will sponsor your feature.

Linked Issue(s)

Part of #4592

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@ndr-brt ndr-brt added the bug Something isn't working label Jan 28, 2025
@ndr-brt ndr-brt marked this pull request as draft January 28, 2025 15:05
@ndr-brt ndr-brt marked this pull request as ready for review January 28, 2025 15:25
ronjaquensel
ronjaquensel previously approved these changes Jan 30, 2025
.processor(processConsumerTransfersInState(RESUMING, this::processConsumerResuming))
.processor(processTransfersInState(COMPLETING, this::processCompleting))
.processor(processTransfersInState(TERMINATING, this::processTerminating))
.processor(processTransfersInState(TERMINATING_REQUESTED, this::processTerminating))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the state TERMINATING_REQUESTED is handled by processTerminating, wouldn't that mean that a TransferTerminationMessage is sent again after one has already been sent by the counter-party? Afaik, only one party should send this message, right?

Copy link
Member Author

@ndr-brt ndr-brt Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's why there's a condition into the sendTransferTerminationMessage.
I thought to bring the condition to the upper lever, but it would had complicated the code much more, because of the nested RetryProcess used. I can take a look if it could refactored into a better shape.

EDIT: it's also described in this class tests :)

Copy link
Contributor

@ronjaquensel ronjaquensel Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I completely missed that. While it reads a bit intransparent at first, if the alternative is refactoring it all in a more complex way, this would be fine with me.

@ronjaquensel ronjaquensel dismissed their stale review January 30, 2025 08:54

misclicked approve instead of comment

Copy link
Contributor

@jimmarino jimmarino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see if the condition mentioned in the comments can be cleaned up in a subsequent PR

@ndr-brt ndr-brt merged commit b78e5ab into eclipse-edc:main Jan 31, 2025
23 checks passed
@ndr-brt ndr-brt deleted the 4592-async-termination branch January 31, 2025 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants