Skip to content

Conversation

@fersaru
Copy link
Contributor

@fersaru fersaru commented Jul 27, 2025

On some hosts, on which waiting for the futureLock.wait(remWait) is faster than 1 millisecond, remWait gets reduced by 123 milliseconds although not even one passed.
As each host has different cycle times, this happens an unknown amount of times.
This causes a ClientChannelEvent.Timeout after a much smaller time passed than the configured timeout.
With these changes, the remWait is calculated based on the milliseconds passed instead of transformed nanoseconds.

The same code is found in ClientSessionImpl@waitFor. This is also addressed.

fersaru added 3 commits July 27, 2025 15:29
On some hosts, on which waiting for the `futureLock.wait(remWait)` is faster than 1 millisecond, `remWait` gets reduced by 123 milliseconds although not even one passed.
This causes a `ClientChannelEvent.Timeout` after a much smaller time passed than the configured timeout.
As each host has different cycle times, this happens an unknown amount of times.
With these changes, the `remWait` is calculated based on the milliseconds passed instead of transformed nanoseconds.
With the removal of the TimeUnit conversion from nanoseconds to milliseconds, import becomes obsolete.
On some hosts, on which waiting for the `futureLock.wait(remWait)` is faster than 1 millisecond, `remWait` gets reduced by 123 milliseconds although not even one passed.
This causes a `ClientSessionEvent.TIMEOUT` after a much smaller time passed than the configured timeout.
As each host has different cycle times, this happens an unknown amount of times.
With these changes, the `remWait` is calculated based on the milliseconds passed instead of transformed nanoseconds.
@fersaru fersaru changed the title AbstractClientChannel@waitFor calculate remWait with passed milliseconds Trigger ClientChannelEvent.Timeout and ClientSessionEvent.TIMEOUT independently to host's program cycle times Jul 29, 2025
@tomaswolf tomaswolf merged commit 99246d6 into apache:master Jul 30, 2025
7 checks passed
@tomaswolf
Copy link
Member

Thank you for this fix. The old code looks like someone put in some placeholder code and forgot to clean up later.

@tomaswolf tomaswolf added the bug An issue describing a bug in the code label Jul 30, 2025
@tomaswolf tomaswolf added this to the 2.16.0 milestone Jul 30, 2025
@fersaru fersaru deleted the fix/abstractclientchannel-remove-123-subtraction-from-remwait branch August 1, 2025 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue describing a bug in the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants