Skip to content
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

Verify potential concurrency issue of repository calls within application services #127

Open
Whathecode opened this issue May 18, 2020 · 3 comments
Assignees
Labels
bug Something isn't working the way it was designed to.

Comments

@Whathecode
Copy link
Member

There might be bugs when multiple repo calls happen within single application service calls (which are expected to be single transactions).

Should we include some notion of repository transaction management within application service hosts?

@Whathecode Whathecode added the bug Something isn't working the way it was designed to. label May 18, 2020
@Whathecode
Copy link
Member Author

Whathecode commented Apr 23, 2021

Should all RPC and event handlers be idempotent by convention?

@Whathecode Whathecode added this to the 1.0.0 stable milestone May 10, 2021
@Whathecode Whathecode removed this from the 1.0.0 stable milestone Mar 15, 2022
@Whathecode
Copy link
Member Author

Potential issues:

  • ParticipationServiceHost.getActiveParticipationInvitations calls both getParticipationInvitations and getParticipantGroupList on ParticipationRepository.
  • ProtocolServiceHost.updateParticipantDataConfiguration calls both getByOrThrow and getVersionHistoryFor on StudyProtocolRepository.

For both of these, the repo can't become inconsistent, but the returned value may be, or the request could fail possibly. This is less critical than if there would have been two update calls, which could result in inconsistent data being stored in the repo.

Therefore, I will keep this issue open so we are aware about these two specific instances, but I will remove it from the 1.0 milestone. These can be patched and wouldn't result in API changes.

P.s. there are also calls to dependent services, but this is a different issue than this one: #295

@Whathecode Whathecode self-assigned this Sep 28, 2022
@Whathecode
Copy link
Member Author

Whathecode commented Oct 24, 2022

At the time of writing, there are no application service calls which contain two update calls. With the fix of #398, out-of-date repo updates can now also be handled by implementing infrastructures.

The potential reported issues above are the only remaining issues. To handle this, a unit of work pattern will need to be implemented for repos: #417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working the way it was designed to.
Projects
None yet
Development

No branches or pull requests

1 participant