connection: always flush data on close.#13892
connection: always flush data on close.#13892PiotrSikora wants to merge 1 commit intoenvoyproxy:masterfrom
Conversation
Fixes envoyproxy#13890. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
| transport_socket_->doWrite(*write_buffer_, type == ConnectionCloseType::NoFlush || | ||
| !transport_socket_->canFlushClose()); | ||
| } | ||
|
|
There was a problem hiding this comment.
Let's start with the usual feedback: please add some tests.
Going beyond that, I'm not 100% sure it makes sense to attempt to flush before close in all cases. It's possible that we don't really mean it when we currently say ConnectionCloseType::NoFlush given that the previous version of this method attempted a write when type was NoFlush. Adding a NoReallyThrowDataAwayAndClose enum type seems like overkill, but it also seems somewhat appropriate.
There was a problem hiding this comment.
Oh, I didn't indent to merge this PR as-is, I've added it here to start the discussion about possible solution for #13890. A test for it would be working FlushWrite in #13858, but that's not merged yet.
At this point I'm not really sure what the current semantics are and why NoFlush does flush data, to be honest.
|
I agree that this should fix the behavior we were seeing, but I don't understand yet why it was failing. In the NoFlush case it was calling |
I don't see |
It's the call to |
I understand the chain of theoretical event, I'm just saying that this ( |
I'm trying to debug what's happening, give me a few minutes. |
This is caused by calling close directly from onEvent, see explanation at https://github.com/envoyproxy/envoy/pull/13858/files/ca79634eb889c3de0c51b74989d3d6704ef4265f#r517692030 |
|
Abandoned (see #13890). |
Fixes #13890.
Signed-off-by: Piotr Sikora piotrsikora@google.com