Skip to content

test: removing a rare flake in tcp proxy integraion test#5919

Merged
alyssawilk merged 1 commit intoenvoyproxy:masterfrom
alyssawilk:flake
Feb 12, 2019
Merged

test: removing a rare flake in tcp proxy integraion test#5919
alyssawilk merged 1 commit intoenvoyproxy:masterfrom
alyssawilk:flake

Conversation

@alyssawilk
Copy link
Contributor

Occasionally we read all the data but not the FIN in waitForData()
waitForDisconnect() would get the half close, and trigger the notification in FakeRawConnection::ReadFilter::onData

Unfortunately this results in a race because in ConnectionImpl we do the onRead, passing data to the filters, before checking bothSidesHalfClosed and actually closing the socket, so when waitForDisconnect() checked connection status it could occasionally still look connected.

I was going to solve in the fake upstream by simply not calling connection_.notifyOne() for a 0 byte onData with fin = true but that would break waitForHalfClose

Risk Level: low (test only)
Testing: 1k runs pass
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk merged commit ab65c4f into envoyproxy:master Feb 12, 2019
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
…5919)

Occasionally we read all the data but not the FIN in waitForData()
waitForDisconnect() would get the half close, and trigger the notification in FakeRawConnection::ReadFilter::onData

Unfortunately this results in a race because in ConnectionImpl we do the onRead, passing data to the filters, before checking bothSidesHalfClosed and actually closing the socket, so when waitForDisconnect() checked connection status it could occasionally still look connected.

Fixing by explicitly waiting for half-close.

_Risk Level_: low (test only)
_Testing_: 1k runs pass
_Docs Changes_: n/a
_Release Notes_: n/a

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Fred Douglas <fredlas@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants