mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Do not set SO_LINGER to 0 when not shutting down (#26871)
This is a follow up to #26764. That commit set SO_LINGER to 0 in order to fix a scenario where we were running out of resources during CI. We are primarily interested in setting this to 0 when stopping the tranport. Allowing TIMED_WAIT is standard for other failure scenarios during normal operation. Unfortunately this commit set SO_LINGER to 0 every time we close NodeChannels. NodeChannels can be closed in case of an exception or other failures (such as parsing a response). We want to only disable linger when actually shutting down.
This commit is contained in:
parent
17b9baf5fd
commit
ca35fcabd0
@ -441,7 +441,8 @@ public abstract class TcpTransport<Channel> extends AbstractLifecycleComponent i
|
||||
public void close() throws IOException {
|
||||
if (closed.compareAndSet(false, true)) {
|
||||
try {
|
||||
closeChannels(Arrays.stream(channels).filter(Objects::nonNull).collect(Collectors.toList()), false, true);
|
||||
closeChannels(Arrays.stream(channels).filter(Objects::nonNull).collect(Collectors.toList()), false,
|
||||
lifecycle.stopped());
|
||||
} finally {
|
||||
transportService.onConnectionClosed(this);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user