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

natsOptions_SetTimeout() not being respected under certain conditions #723

Open
jakeobrien opened this issue Mar 10, 2024 · 0 comments
Open
Assignees
Labels
defect Suspected defect such as a bug or regression

Comments

@jakeobrien
Copy link

jakeobrien commented Mar 10, 2024

Observed behavior

When testing with a very poor network, setting a connection timeout with natsOptions_SetTimeout() is not being respected. Regardless of what I set in milliseconds, the connection times out consistently at 30 seconds per server.

I am using iOS's Network Link Conditioner to simulate a very poor network with 100% packet loss.

The timeout is respected when testing with radios disabled (airplane mode).

For testing purposes, I set natsOptions_SetRetryOnFailedConnect() to false and set a callback there, which is not being called. So, no connection retries should be happening.

Other options are being respected, so I do not believe it is an issue setting options.

Expected behavior

The timeout should be respected. For example setting natsOptions_SetTimeout(opts, 5000) should time out after 10 seconds with two servers.

Server and client version

nats-server: v2.10.3
nats.c client: v3.7.0

Host environment

Client is on various configurations of iPhone hardware and iOS version (recent).

Steps to reproduce

  • Launch Nats client with normally connected network and connection timeout set to 5s per server
  • Connect to Nats server to ensure it is responding
  • Disconnect
  • Set Network Link Conditioner to 100% packet loss
  • Attempt to connect to server

Timeout will not trigger for 30 seconds after initiating the connection attempt.

@jakeobrien jakeobrien added the defect Suspected defect such as a bug or regression label Mar 10, 2024
@levb levb self-assigned this Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

2 participants