diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-22 16:13:04 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-22 16:13:04 -0800 |
| commit | 2c21481ee82e92330baf052858a21bcb2b84640a (patch) | |
| tree | 773fbc5cb72032aac450ca1be342f359e17147fd | |
| parent | 1aeddc63fdde9d67359214b7a800509351a4d17f (diff) | |
| download | nng-2c21481ee82e92330baf052858a21bcb2b84640a.tar.gz nng-2c21481ee82e92330baf052858a21bcb2b84640a.tar.bz2 nng-2c21481ee82e92330baf052858a21bcb2b84640a.zip | |
dialer: configure default redial cool-down times (fixes #1964)
The missing default of zero leads to a hard spin and exhaustion of
the open files (since reaping can take too long).
The workaround is to configure these explicitly.
| -rw-r--r-- | src/core/dialer.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/dialer.c b/src/core/dialer.c index 78122646..d684fd47 100644 --- a/src/core/dialer.c +++ b/src/core/dialer.c @@ -217,11 +217,14 @@ nni_dialer_init(nni_dialer *d, nni_sock *s, nni_sp_tran *tran) int rv; void *dp; - d->d_closed = false; - d->d_data = NULL; - d->d_ref = 1; - d->d_sock = s; - d->d_tran = tran; + d->d_closed = false; + d->d_data = NULL; + d->d_ref = 1; + d->d_sock = s; + d->d_tran = tran; + d->d_inirtime = NNI_SECOND / 100; // 10ms + d->d_maxrtime = NNI_SECOND; + d->d_currtime = d->d_inirtime; nni_atomic_flag_reset(&d->d_started); // Make a copy of the endpoint operations. This allows us to |
