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

Ensure Idempotency in A_TO_RecycleTripDriver Function #109

Open
NullPointer4096 opened this issue Apr 23, 2023 · 0 comments
Open

Ensure Idempotency in A_TO_RecycleTripDriver Function #109

NullPointer4096 opened this issue Apr 23, 2023 · 0 comments

Comments

@NullPointer4096
Copy link

NullPointer4096 commented Apr 23, 2023

Description:
The A_TO_RecycleTripDriver function in the TripMonitorOrchestrator does not currently handle idempotency. This can lead to processing the same event multiple times, which may cause unwanted side effects, such as incorrect driver status updates. To address this issue, we need to store a unique identifier for each trip's recycling event in a persistent storage and ensure that each event is processed only once.

Steps to reproduce:

  1. Run the TripMonitorOrchestrator.
  2. Simulate an error exit after the ServiceFactory.GetLoggerService().Log api but before the function completes
  3. Trigger the A_TO_RecycleTripDriver function through by invoking the orchestrator. Let the first run fail.
  4. Let the function retry automatically.

Expected behavior:
The A_TO_RecycleTripDriver function should process the trip recycling event only once and skip any subsequent calls with the same trip.

Actual behavior:
The A_TO_RecycleTripDriver function will invoke the ServiceFactory.GetLoggerService().Log api more than once on error exit. Thus, there will be duplicated messages.

Proposed Solution:
We should have the front end deduplicate the recycling event for the trip has already been processed. This can be done by maintaining the last processed id in some queryable storage or memory. If the event id matches the last processed id. skip the processing to maintain idempotency.

Thank you for your contribution to the Github community and I really appreciate your effort in following through this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant