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

Fixes class of canceled on client issues #614

Closed
wants to merge 1 commit into from

Conversation

paulyuk
Copy link
Contributor

@paulyuk paulyuk commented Jul 31, 2024

Description

This fixes #595 and class of canceled on client errors seen in the workflow API examples.

I observed that:

  • workflowRuntime.stop() is being called in the start() method

A fixed I used is to:

  • move workflowRuntime.stop() to a process on SIGTERM function/handler
process.on('SIGTERM', () => {
  workflowRuntime.stop();
})
  • move the declarations of workflowRuntime out of start and into the file scope, along with daprHost and daprPort so they are all visible to the new process.on SIGTERM handler

Issue reference

Please reference the issue this PR will close: #595

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Signed-off-by: Paul Yuknewicz <paulyuk@microsoft.com>
@paulyuk paulyuk added bug Something isn't working P1 labels Jul 31, 2024
@paulyuk paulyuk added this to the v3.3.1 milestone Jul 31, 2024
@paulyuk paulyuk self-assigned this Jul 31, 2024
@paulyuk paulyuk requested review from a team as code owners July 31, 2024 05:00
@@ -139,6 +139,10 @@ async function promptForApproval(approver: string, workflowClient: DaprWorkflowC
}
}

process.on('SIGTERM', () => {

Choose a reason for hiding this comment

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

image
grpc/grpc-node#2233

Proper fix would be adding error handler to take care of CANCELLED status. Although it is not critical for tutorials but for general javascript SDK client, it should be handled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will take a look. thank you for this

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, it would need a better handling through some error handler kind of mechanism.

@paulyuk
Copy link
Contributor Author

paulyuk commented Aug 20, 2024

We believe this is not right fix now.

@paulyuk paulyuk closed this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1
Projects
Development

Successfully merging this pull request may close these issues.

Stream error Error: 1 CANCELLED: Cancelled on client
3 participants