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 #726 #727

Merged
merged 1 commit into from Jun 19, 2020
Merged

fixes #726 #727

merged 1 commit into from Jun 19, 2020

Conversation

GavinChenYan
Copy link
Contributor

add fix for two places:

  1. for service lookup, always use lastIndex as 0L to avoid consul blocking queries.
  2. Implementations must check to see if a returned index is lower than the previous value, and if it is, should reset index to 0

@codecov-commenter
Copy link

codecov-commenter commented Jun 19, 2020

Codecov Report

Merging #727 into 1.6.x will increase coverage by 0.00%.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              1.6.x     #727   +/-   ##
=========================================
  Coverage     49.87%   49.87%           
- Complexity     1921     1923    +2     
=========================================
  Files           261      261           
  Lines         11750    11756    +6     
  Branches       1667     1670    +3     
=========================================
+ Hits           5860     5863    +3     
- Misses         5194     5198    +4     
+ Partials        696      695    -1     
Impacted Files Coverage Δ Complexity Δ
...main/java/com/networknt/consul/ConsulRegistry.java 50.00% <25.00%> (-1.24%) 21.00 <3.00> (ø)
...n/java/com/networknt/client/oauth/OauthHelper.java 36.93% <0.00%> (+0.60%) 28.00% <0.00%> (+2.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4fbf810...78bbb9b. Read the comment docs.

Copy link
Contributor

@stevehu stevehu left a comment

Choose a reason for hiding this comment

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

The fix looks good. For active lookup triggered by request, always use 0L to get an immediate return. For the subscription thread, use block query by passing in the last index. In case that the last index returned from the Consul is smaller, reset the index to 0L.

@stevehu stevehu merged commit b96ed68 into 1.6.x Jun 19, 2020
@stevehu stevehu deleted the issue_726 branch June 19, 2020 15:21
stevehu pushed a commit that referenced this pull request Jun 19, 2020
younggwon1 pushed a commit to younggwon1/light-4j that referenced this pull request Feb 10, 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.

None yet

3 participants