aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorErlang/OTP <otp@erlang.org>2017-06-07 15:19:26 +0200
committerErlang/OTP <otp@erlang.org>2017-06-07 15:19:26 +0200
commit4310a9d387999ada6135082961350b6f4324dcb7 (patch)
tree41441ceacfd13d19cf2952cd51228633eacda583 /erts
parent87bca557898bea79dbd53d59b21f6e7384e3a25d (diff)
parentae8d3bc9b32e95ce6f9a2da3b6ae961f04071c36 (diff)
downloadotp-4310a9d387999ada6135082961350b6f4324dcb7.tar.gz
otp-4310a9d387999ada6135082961350b6f4324dcb7.tar.bz2
otp-4310a9d387999ada6135082961350b6f4324dcb7.zip
Merge branch 'john/erts/fix-zombie-tcp-ports/ERL-430/OTP-14441' into maint-19
* john/erts/fix-zombie-tcp-ports/ERL-430/OTP-14441: Unconditionally clear IO buffers on send/shutdown errors
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/drivers/common/inet_drv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index 1885338ce5..ebd13e6f05 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -10386,6 +10386,9 @@ static int tcp_send_or_shutdown_error(tcp_descriptor* desc, int err)
set_busy_port(desc->inet.port, 0);
}
+ tcp_clear_output(desc);
+ tcp_clear_input(desc);
+
/*
* We used to handle "expected errors" differently from unexpected ones.
* Now we handle all errors in the same way (unless the show_econnreset
@@ -10408,8 +10411,6 @@ static int tcp_send_or_shutdown_error(tcp_descriptor* desc, int err)
else
desc_close(INETP(desc));
} else {
- tcp_clear_output(desc);
- tcp_clear_input(desc);
tcp_close_check(desc);
erl_inet_close(INETP(desc));