-
Notifications
You must be signed in to change notification settings - Fork 17
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
[CAPPL-536] Workflow update not picked up by Syncer #1029
Conversation
d80a1aa
to
b5783e6
Compare
b5783e6
to
975bdb1
Compare
975bdb1
to
1e81679
Compare
e394a58
to
46388e4
Compare
|
||
if ackMsg.GetResponse().GetError() != "" { | ||
return nil, errors.New(fmt.Sprintf("failed registering trigger: %s", ackMsg.GetResponse().GetError())) | ||
} |
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.
@agparadiso This code is a bit ambiguous I think: what happens if the server sends a response without an ack? We should clearly error in that case as that would mean the protocol has been violated.
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.
changed to send: TriggerResponseMessage_Ack
and fail if ackMsg.GetAck() == nil
much cleaner, thanks🙇🏼
} | ||
if err = server.Send(msg); err != nil { | ||
return fmt.Errorf("failed sending error response for trigger registration %s: %w", request, err) | ||
} | ||
return fmt.Errorf("error registering trigger: %w", err) |
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.
No need to return an error in this case, you already returned it back to the caller successfully, just return nil.
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.
Better yet, I think return server.Send(msg)
is enough
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.
true, done 👍🏼
This reverts commit 6817814.
Description
we were seeing these errors:
In order to reproduce the issue:
Why is this happening?
communication between client and server is not synchronous, if the trigger failed to be registered (eg: when registering a workflow with a cron schedule lower than 30s) this error was being dragged to the forwardTriggerResponsesToChannel, the trigger was never registered and we were trying to Unregister a non existing trigger .
The fix
In order to avoid this Im sending a first ACK/ERROR message that will block until this is received. if there is an error registering the trigger in the first place this will be handled properly
How was this tested?
Added a unit test reproducing the error + tested on a local DON
CAPPL-536