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

[fix][fn] Throw 404 RestException when state key not found #21921

Merged
merged 2 commits into from
Jan 19, 2024

Conversation

jiangpengcheng
Copy link
Contributor

@jiangpengcheng jiangpengcheng commented Jan 18, 2024

Motivation

500 error is returned for querystate when the key doesn't exist.

it's related to #21597

Modifications

return 404 error when key doesn't exist

Verifying this change

  • Make sure that the change passes the CI checks.

  • Add tests to query non-exist state key in:

    • org.apache.pulsar.tests.integration.functions.PulsarStateTest.testSourceState
    • org.apache.pulsar.tests.integration.functions.PulsarStateTest.testSinkState

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: jiangpengcheng#22

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 18, 2024
@Technoboy- Technoboy- added this to the 3.2.0 milestone Jan 18, 2024
@Technoboy-
Copy link
Contributor

Technoboy- commented Jan 18, 2024

image
Do we also need to revert the logic in the red range?

@Technoboy- Technoboy- added the release/blocker Indicate the PR or issue that should block the release until it gets resolved label Jan 18, 2024
@Technoboy-
Copy link
Contributor

Oh, can we add a test for this? We find this in the release stage.

@jiangpengcheng
Copy link
Contributor Author

Oh, can we add a test for this? We find this in the release stage.

Sure, i will add a test tomorrow

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (22838ea) 36.46% compared to head (374ac87) 73.57%.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #21921       +/-   ##
=============================================
+ Coverage     36.46%   73.57%   +37.11%     
- Complexity    12390    32390    +20000     
=============================================
  Files          1725     1861      +136     
  Lines        131701   138595     +6894     
  Branches      14401    15185      +784     
=============================================
+ Hits          48027   101978    +53951     
+ Misses        77254    28724    -48530     
- Partials       6420     7893     +1473     
Flag Coverage Δ
inttests 24.12% <0.00%> (+0.01%) ⬆️
systests 23.68% <100.00%> (+0.01%) ⬆️
unittests 72.87% <0.00%> (+40.83%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ulsar/functions/worker/rest/api/ComponentImpl.java 47.92% <100.00%> (+26.37%) ⬆️

... and 1437 files with indirect coverage changes

@Technoboy- Technoboy- merged commit 0f2523f into apache:master Jan 19, 2024
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test release/blocker Indicate the PR or issue that should block the release until it gets resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants