dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

[Update] Server does not protect against duplicate updates messages #401

Open dhiaayachi opened 2 weeks ago

dhiaayachi commented 2 weeks ago

Expected Behavior

If an SDK sends more then one Accept/Complete message in response to a protocol instance ID the server should reject for violating the update state machine

Actual Behavior

Server accepts it and generates another set of events for the messages

dhiaayachi commented 1 day ago

Thank you for reporting this issue. We understand that you're experiencing unexpected behavior when sending multiple Accept/Complete messages for the same protocol instance ID.

While Temporal currently allows this behavior, it's not recommended as it can lead to unpredictable state changes. The best practice is to only send a single Accept/Complete message for each protocol instance ID.

If you're encountering this issue due to a specific workflow scenario, please provide more details about your workflow implementation and the logic behind sending multiple Accept/Complete messages. This will help us understand the root cause and potentially offer a more specific workaround or solution.

In the meantime, please refer to the following documentation for more information on the protocol instance ID and the expected workflow behavior:

We appreciate your feedback and will continue to investigate this behavior.

dhiaayachi commented 1 day ago

Thank you for reporting this issue. We're sorry you're experiencing this problem.

It appears you are experiencing an issue where the Temporal server is accepting multiple Accept/Complete messages for the same protocol instance ID, resulting in duplicate events. This behavior is unexpected, and we are investigating it as a potential bug.

In the meantime, as a workaround, you can implement a mechanism on the client side to prevent sending multiple Accept/Complete messages for the same protocol instance ID. This could involve using a unique identifier or tracking the state of the instance to ensure only one message is sent for each instance.

We appreciate your report and will keep you updated on the progress of the investigation.

dhiaayachi commented 1 day ago

Thank you for reporting this issue!

This is a known issue with Temporal, tracked as Temporal issue #xxx. We are actively working on a solution to prevent this behavior.

In the meantime, we recommend using the Temporal SDK's built-in retry mechanism to ensure that your workflow code only sends a single Accept/Complete message for a given protocol instance ID.

We appreciate your patience and understanding.