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

[Backport 0.24] fix(gateway): map exception to correct error code #5402

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

korthout
Copy link
Member

@korthout korthout commented Sep 22, 2020

Description

backports #5228

  • Previous BrokerException was directly returned to the client, it is now mapped to the correct StatusException and code.
  • The error message was rewritten to make more clear what has happened.

Related issues

fixes #5187
closes #5387

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement

 * Previous BrokerException was directly returned to the client, it is now mapped to the correct StatusException and code.
 * The error message was rewritten to make more clear what has happened.

(cherry picked from commit 221f866)
@korthout korthout changed the base branch from develop to stable/0.24 September 22, 2020 13:33
@camunda camunda deleted a comment from GitCop Sep 22, 2020
@korthout korthout requested a review from saig0 September 22, 2020 14:08
@korthout
Copy link
Member Author

@saig0 Can you have a look? It's a direct cherry pick

Copy link
Member

@saig0 saig0 left a comment

Choose a reason for hiding this comment

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

Thanks 🍪

Please test the fix manually since there are no automated tests :)

@korthout
Copy link
Member Author

Reproduced problem by:

  1. checkout stable/0.24
  2. build broker and run
  3. deploy a simple workflow (start -> service task (jobtype: test) -> end)
  4. stop broker
  5. change broker to always reply RESOURCE_EXHAUSTED (CommandApiRequestHandler#L137=> if(true))
  6. restart broker
  7. zbctl --insecure create worker test --handler=cat
2020/09/25 10:04:23 Failed to activate jobs for worker zbctl rpc error: code = Unknown desc =
2020/09/25 10:04:24 Failed to activate jobs for worker zbctl rpc error: code = Unknown desc =
2020/09/25 10:04:24 Failed to activate jobs for worker zbctl rpc error: code = Unknown desc =
2020/09/25 10:04:24 Failed to activate jobs for worker zbctl rpc error: code = Unknown desc =
2020/09/25 10:04:24 Failed to activate jobs for worker zbctl rpc error: code = Unknown desc =

Manual test of fix by:

  1. stop broken broker
  2. checkout zell-5187-grpc-resource-exhausted-0.24, but change again that broker always replies RESOURCE_EXHAUSTED
  3. restart broker
  4. zbctl --insecure create worker test --handler=cat
2020/09/25 10:12:16 Failed to activate jobs for worker zbctl rpc error: code = ResourceExhausted desc = Expected to activate jobs of type 'test', but no jobs available and at least one broker returned 'RESOURCE_EXHAUSTED'. Please try again later.
2020/09/25 10:12:16 Failed to activate jobs for worker zbctl rpc error: code = ResourceExhausted desc = Expected to activate jobs of type 'test', but no jobs available and at least one broker returned 'RESOURCE_EXHAUSTED'. Please try again later.
2020/09/25 10:12:16 Failed to activate jobs for worker zbctl rpc error: code = ResourceExhausted desc = Expected to activate jobs of type 'test', but no jobs available and at least one broker returned 'RESOURCE_EXHAUSTED'. Please try again later.
2020/09/25 10:12:16 Failed to activate jobs for worker zbctl rpc error: code = ResourceExhausted desc = Expected to activate jobs of type 'test', but no jobs available and at least one broker returned 'RESOURCE_EXHAUSTED'. Please try again later.
2020/09/25 10:12:17 Failed to activate jobs for worker zbctl rpc error: code = ResourceExhausted desc = Expected to activate jobs of type 'test', but no jobs available and at least one broker returned 'RESOURCE_EXHAUSTED'. Please try again later.

@korthout
Copy link
Member Author

bors r+

zeebe-bors bot added a commit that referenced this pull request Sep 25, 2020
5402: [Backport 0.24] fix(gateway): map exception to correct error code r=korthout a=korthout

## Description

backports #5228

- Previous BrokerException was directly returned to the client, it is now mapped to the correct StatusException and code.
- The error message was rewritten to make more clear what has happened.

## Related issues

fixes #5187
closes #5387

## Definition of Done

_Not all items need to be done depending on the issue and the pull request._

Code changes:
* [ ] The changes are backwards compatibility with previous versions
* [ ] If it fixes a bug then PRs are created to [backport](https://github.com/zeebe-io/zeebe/compare/stable/0.24...develop?expand=1&template=backport_template.md&title=[Backport%200.24]) the fix to the last two minor versions

Testing:
* [ ] There are unit/integration tests that verify all acceptance criterias of the issue
* [ ] New tests are written to ensure backwards compatibility with further versions
* [ ] The behavior is tested manually
* [ ] The impact of the changes is verified by a benchmark 

Documentation: 
* [ ] The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
* [ ] New content is added to the [release announcement](https://drive.google.com/drive/u/0/folders/1DTIeswnEEq-NggJ25rm2BsDjcCQpDape)


Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
@zeebe-bors
Copy link
Contributor

zeebe-bors bot commented Sep 25, 2020

Build failed:

@korthout
Copy link
Member Author

Flaky tests #5097 and #5098.

bors retry

@zeebe-bors
Copy link
Contributor

zeebe-bors bot commented Sep 25, 2020

Build succeeded:

@zeebe-bors zeebe-bors bot merged commit 2bbc72a into stable/0.24 Sep 25, 2020
@zeebe-bors zeebe-bors bot deleted the zell-5187-grpc-resource-exhausted-0.24 branch September 25, 2020 10:11
github-merge-queue bot pushed a commit that referenced this pull request Mar 14, 2024
* style: add tenant column in did page and update version link

* chore: remove api mock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants