Skip to content

Commit 72609d0

Browse files
Apply suggestions from code review
Co-authored-by: Devin Holland <50112339+Devin-Holland@users.noreply.github.com>
1 parent bfce800 commit 72609d0

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,10 @@ Two limits on where these settings apply:
795795
here, so the default is unaffected, but a raised or lowered value has no effect on those routes.
796796
PROXY-protocol routes, including every UDS route, take the plain path and are governed normally.
797797
- **A config reload cannot change these.** They are frozen when the proxy is constructed, so
798-
`symphony-server` recreates the proxy (seamlessly, via `SO_REUSEPORT`) when one of them changes
799-
rather than hot-swapping it.
798+
changing one makes `symphony-server` recreate the proxy rather than hot-swap it. `SO_REUSEPORT`
799+
means there is no *bind* gap, but established connections on the old proxy are **not** drained —
800+
`stop()` waits 100 ms and connection tasks are detached — so they are all dropped. On a
801+
high-connection-count listener, treat a buffer-size edit as a reconnect event, not a live tune.
800802

801803
> **Upgrading:** before this setting was applied to the copy loop, `readBufferSize` had no effect —
802804
> every connection got 8 KiB per direction regardless of what the config said, and the default

src/proxy.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,14 @@ impl SymphonyProxyWrap {
317317
} else {
318318
Duration::ZERO
319319
};
320+
let base_read_buffer_size = resolve_copy_buffer_size(config.read_buffer_size, "readBufferSize");
320321
let client_read_buffer_size = match config.client_read_buffer_size {
321322
Some(v) => resolve_copy_buffer_size(Some(v), "clientReadBufferSize"),
322-
None => resolve_copy_buffer_size(config.read_buffer_size, "readBufferSize"),
323+
None => base_read_buffer_size,
323324
};
324325
let upstream_read_buffer_size = match config.upstream_read_buffer_size {
325326
Some(v) => resolve_copy_buffer_size(Some(v), "upstreamReadBufferSize"),
326-
None => resolve_copy_buffer_size(config.read_buffer_size, "readBufferSize"),
327+
None => base_read_buffer_size,
327328
};
328329

329330
let mut internal_listeners = Vec::new();

0 commit comments

Comments
 (0)