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

feat: Adds error handling around actor deactivation #628

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MrMint
Copy link

@MrMint MrMint commented Aug 26, 2024

Description

Avoid crashing the app when either a deactivate request for a non-activated actor is received or an actors onDeactivate() throws an error. Let me know if this is on the right track or if a different pattern would be preferred and I'll take a look at updating/adding tests. I took a look at a few of the other sdk implementations and it wasn't clear to me if returning specific http statuses to daprd adds value.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #627

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

@dapr-bot
Copy link
Collaborator

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@yaron2
Copy link
Member

yaron2 commented Oct 4, 2024

@MrMint see the failing test

res.statusCode = HttpStatusCode.OK;
return this.handleResult(res, result);
case DeactivateResult.Error:
res.statusCode = HttpStatusCode.INTERNAL_SERVER_ERROR;
Copy link
Author

Choose a reason for hiding this comment

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

Does returning specific http status codes for the unhappy path provide value to the dapr sidecar?

@MrMint
Copy link
Author

MrMint commented Oct 4, 2024

@MrMint see the failing test

It will be a few days before I can take a look at setting up those e2e tests locally. I'd be a little surprised if this code broke those. Looks like they may be failing historically https://github.com/dapr/js-sdk/actions/workflows/test-e2e.yml

@dapr-bot
Copy link
Collaborator

dapr-bot commented Nov 3, 2024

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@dapr-bot dapr-bot added the stale label Nov 3, 2024
@dapr-bot
Copy link
Collaborator

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@dapr-bot dapr-bot closed this Nov 10, 2024
@yaron2 yaron2 reopened this Nov 11, 2024
@dapr-bot dapr-bot removed the stale label Nov 11, 2024
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

Successfully merging this pull request may close these issues.

Actor deactivate errors causing app to crash
3 participants