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

Make RetryingClient handle negative nano time properly #2584

Merged
merged 1 commit into from
Mar 13, 2020

Conversation

ikhoon
Copy link
Contributor

@ikhoon ikhoon commented Mar 13, 2020

Motivation:

System.nanoTime() can return a negative number.
So the sum of System.nanoTime() and responseTimeoutMills can also be zero
even if responseTimeoutMillis is positive.

Modifications:

  • Add isTimeoutEnabled flag for checking whether the timeout was set
    or not

Result:
Remove a potential timeout bug

…Client

Motivation:

`System.nanoTime()` can return a negative number.
The sum of `System.nanoTime()` and `responseTimeoutMills` can be zero,
even if `responseTimeoutMillis` is positive.

Modifications:

- Add `isTimeoutEnabled` flag for checking whether the timeout was set
  or not

Result:
Remove a potential timeout bug
@ikhoon ikhoon added the defect label Mar 13, 2020
@ikhoon ikhoon requested review from minwoox and trustin as code owners March 13, 2020 13:23
@trustin trustin added this to the 0.98.5 milestone Mar 13, 2020
Copy link
Contributor

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Thank!

@trustin trustin changed the title Fix a bug where a timeout is ignored by negative nanotime in Retrying… Make RetryingClient handle negative nano time properly Mar 13, 2020
@trustin trustin merged commit a9d246d into line:master Mar 13, 2020
trustin pushed a commit that referenced this pull request Mar 13, 2020
Motivation:

`System.nanoTime()` can return a negative number.
The sum of `System.nanoTime()` and `responseTimeoutMills` can be zero,
even if `responseTimeoutMillis` is positive.

Modifications:

- Add `isTimeoutEnabled` flag for checking whether the timeout was set
  or not

Result:
Remove a potential timeout bug
@ikhoon ikhoon deleted the add-timeout-flag branch March 18, 2020 13:50
fmguerreiro pushed a commit to fmguerreiro/armeria that referenced this pull request Sep 19, 2020
Motivation:

`System.nanoTime()` can return a negative number.
The sum of `System.nanoTime()` and `responseTimeoutMills` can be zero,
even if `responseTimeoutMillis` is positive.

Modifications:

- Add `isTimeoutEnabled` flag for checking whether the timeout was set
  or not

Result:
Remove a potential timeout bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants