Skip to content

connection: don't raise connected event if connection already closed#20469

Merged
mattklein123 merged 4 commits intomainfrom
connection_event
Mar 23, 2022
Merged

connection: don't raise connected event if connection already closed#20469
mattklein123 merged 4 commits intomainfrom
connection_event

Conversation

@mattklein123
Copy link
Member

Fixes #20438

Risk Level: Medium. Should be OK but still scary.
Testing: Modified UT.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Fixes #20438

Signed-off-by: Matt Klein <mklein@lyft.com>
@mattklein123
Copy link
Member Author

cc @ravenblackx

// connected events.
// If a previous connected callback closed the connection, don't raise any further connected
// events. There was already recursion raising closed events.
if (event == ConnectionEvent::Connected && state() != State::Open) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @danzh2010 I think this will be a semantic merge conflict with your ongoing change FYI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this change be applied to any non-close event? instead of event == ConnectionEvent::Connected, using event != ConnectionEvent::LocalClosed && event != ConnectionEvent::RemoteClosed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure happy to make that change. Either way it's pretty fragile. :(

Signed-off-by: Matt Klein <mklein@lyft.com>
danzh2010
danzh2010 previously approved these changes Mar 22, 2022
Copy link
Contributor

@danzh2010 danzh2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alyssawilk
Copy link
Contributor

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20469 (comment) was created by @alyssawilk.

see: more, trace.

Signed-off-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
@mattklein123 mattklein123 enabled auto-merge (squash) March 23, 2022 15:31
@mattklein123 mattklein123 merged commit 813c20e into main Mar 23, 2022
@mattklein123 mattklein123 deleted the connection_event branch March 23, 2022 18:43
ravenblackx pushed a commit to ravenblackx/envoy that referenced this pull request Jun 8, 2022
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.

Connection event continues to propagate even if disconnected during one event

3 participants