The connection manager retries dropped connections with an exponential backoff that is fixed at module-level constants.
They are hard coded to start at 1000ms and maxes out at 30_000ms.
There is no way for an app to tune these. Apps that want faster recovery, or a gentler backoff, currently cannot change them. I for one require different values as my player base is 95% mobile browser in flaky connections areas.
Proposal: let the delays be set on the builder, e.g.
DbConnection.builder()
.withUri(...)
.withDatabaseName(...)
.withReconnectOptions({ baseDelayMs: 500, maxDelayMs: 10_000 })
Open question for maintainers: field naming. The linked PR uses baseDelayMs / maxDelayMs to match the existing constant names, with baseDelayMs documented as the minimum (first-retry) delay. minDelayMs / maxDelayMs may read better for consumers. Happy to rename.
The connection manager retries dropped connections with an exponential backoff that is fixed at module-level constants.
They are hard coded to start at
1000msand maxes out at30_000ms.There is no way for an app to tune these. Apps that want faster recovery, or a gentler backoff, currently cannot change them. I for one require different values as my player base is 95% mobile browser in flaky connections areas.
Proposal: let the delays be set on the builder, e.g.
Open question for maintainers: field naming. The linked PR uses
baseDelayMs/maxDelayMsto match the existing constant names, withbaseDelayMsdocumented as the minimum (first-retry) delay.minDelayMs/maxDelayMsmay read better for consumers. Happy to rename.