Skip to content

resolves: 1035 - Use ConnectTimeout when awaiting INFO signal#1039

Merged
mtmk merged 1 commit into
nats-io:mainfrom
ptsteward:fix/nats-1035/request-timeout-used-for-connecting
Jan 14, 2026
Merged

resolves: 1035 - Use ConnectTimeout when awaiting INFO signal#1039
mtmk merged 1 commit into
nats-io:mainfrom
ptsteward:fix/nats-1035/request-timeout-used-for-connecting

Conversation

@ptsteward

Copy link
Copy Markdown
Contributor

Context: Issue #1035

After a successful NATS Connection, upon loss of that connection the configured retry policy/settings are executed. During this reconnect/retry loop, if the NATS Server is unreachable, we land on NatsConnection.cs:line:529, specifically the WaitAsync hanging on the waitForInfoSignal Task. This respects the timeout provided via RequestTimeout of the connection's NatsOpts.
In my use-case, the default RequestTimeout needs to be relatively long, on the order of ~1 minute. That led to observing Retries seemingly hanging well beyond expectations, I had expected the timeout to be the ConnectTimeout, not the RequestTimeout.

This Change

This PR swaps the timeout from NatsOpts.RequestTimeout to the expected NatsOpts.ConnectTimeout.

@mtmk mtmk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM thanks @ptsteward

@mtmk mtmk added the breaking label Jan 14, 2026
@mtmk
mtmk merged commit 49c5820 into nats-io:main Jan 14, 2026
17 checks passed
mtmk added a commit that referenced this pull request Jan 14, 2026
* Fix and improve build for docs ci error (#1040)
* resolves: 1035 - Use ConnectTimeout when awaiting INFO signal (#1039)
@mtmk mtmk mentioned this pull request Jan 14, 2026
mtmk added a commit that referenced this pull request Jan 14, 2026
* resolves: 1035 - Use ConnectTimeout when awaiting INFO signal (#1039)
* Fix slow consumer blocking (#1041)
mtmk added a commit that referenced this pull request Feb 10, 2026
Changes in this release:
* Fix StreamSourceInfo.Active handle -1 correctly (#1058)
* Fix NatsUri not reflecting host/port changes from OnConnectingAsync hook (#997)

Chanfes from preview.2
* Fix OTel activity leak in Direct request mode (#1047)
* Fix subject UTF-8 encoding (#1054)
* Add SlowConsumerDetected event and warnings (#1052)
* Fixed unobserved exceptions surfacing due to unobserved tcs. (#1051)

Changes from preview.1
* Fix and improve build for docs ci error (#1040)
* resolves: 1035 - Use ConnectTimeout when awaiting INFO signal (#1039)
* Fix slow consumer blocking (#1041)
@mtmk mtmk mentioned this pull request Feb 10, 2026
mtmk added a commit that referenced this pull request Feb 10, 2026
Changes in this release:
* Fix StreamSourceInfo.Active handle -1 correctly (#1058)
* Fix NatsUri not reflecting host/port changes from OnConnectingAsync hook (#997)

Chanfes from preview.2
* Fix OTel activity leak in Direct request mode (#1047)
* Fix subject UTF-8 encoding (#1054)
* Add SlowConsumerDetected event and warnings (#1052)
* Fixed unobserved exceptions surfacing due to unobserved tcs. (#1051)

Changes from preview.1
* Fix and improve build for docs ci error (#1040)
* resolves: 1035 - Use ConnectTimeout when awaiting INFO signal (#1039)
* Fix slow consumer blocking (#1041)
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.

NATS.Client.Core - Reconnect Retries Bound by RequestTimeout - NatsConection.cs:line:529

2 participants