Skip to content

close(FlushWrite) doesn't write pending data #13890

@PiotrSikora

Description

@PiotrSikora

From: #13858 (comment)

Description:

It looks that close(FlushWrite) doesn't flush any pending data.

Repro steps:

  1. Checkout tls: fix detection of the upstream connection close event. #13858 (uses close(NoFlush)).
  2. $ bazel test //test/extensions/transport_sockets/tls:ssl_socket_test --test_arg="--gtest_filter=*Shutdown*"
  3. Apply patch from tls: fix detection of the upstream connection close event. #13858 (comment) (uses close(FlushWrite)).
  4. $ 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions