From: #13858 (comment)
Description :
It looks that close(FlushWrite) doesn't flush any pending data.
Repro steps :
Checkout tls: fix detection of the upstream connection close event. #13858 (uses close(NoFlush)).
$ bazel test //test/extensions/transport_sockets/tls:ssl_socket_test --test_arg="--gtest_filter=*Shutdown*"
Apply patch from tls: fix detection of the upstream connection close event. #13858 (comment) (uses close(FlushWrite)).
$ bazel test //test/extensions/transport_sockets/tls:ssl_socket_test --test_arg="--gtest_filter=*Shutdown*"
Logs :
With close(NoFlush):
[C1] socket event: 3
[C1] write ready
[C1] read ready. dispatch_buffered_data=false
[C1] socket event: 3
[C1] write ready
[C1] writing 5 bytes, end_stream false
[C1] closing data_to_write=5 type=1
[C1] ssl write returns: 5
[C1] SSL shutdown: rc=0
[C1]
[C1] closing socket: 1
With close(FlushWrite):
[C1] socket event: 3
[C1] write ready
[C1] read ready. dispatch_buffered_data=false
[C1] socket event: 3
[C1] write ready
[C1] writing 5 bytes, end_stream false
[C1] closing data_to_write=5 type=0
[C1] closing socket: 0
[C1] SSL shutdown: rc=0
[C1]
Note missing ssl write returns: 5.
cc @ggreenway @antoniovicente
From: #13858 (comment)
Description:
It looks that
close(FlushWrite)doesn't flush any pending data.Repro steps:
close(NoFlush)).$ bazel test //test/extensions/transport_sockets/tls:ssl_socket_test --test_arg="--gtest_filter=*Shutdown*"close(FlushWrite)).$ bazel test //test/extensions/transport_sockets/tls:ssl_socket_test --test_arg="--gtest_filter=*Shutdown*"Logs:
With
close(NoFlush):With
close(FlushWrite):Note missing
ssl write returns: 5.cc @ggreenway @antoniovicente