Skip to content

Listener: fix a crash when updating any listener that does not bind to port#18421

Merged
mattklein123 merged 17 commits intoenvoyproxy:mainfrom
lambdai:fixduplicate
Oct 7, 2021
Merged

Listener: fix a crash when updating any listener that does not bind to port#18421
mattklein123 merged 17 commits intoenvoyproxy:mainfrom
lambdai:fixduplicate

Conversation

@lambdai
Copy link
Copy Markdown
Contributor

@lambdai lambdai commented Oct 5, 2021

Commit Message:
Fix the crash caused by listener update when the any listener set bind_to_port to false.
A listener does not bind to port has no io handle. close() already check it.
Now add the check to isOpen().

Also the Tcp(or Udp)ListenSocket::duplicate() creates parent ListenSocketImpl
Make it returning the derived ListenSocket, either TcpListenSocket or UdpListenSocket

Additional Description:
Risk Level:
Testing: Unit test on duplicate. Integration test on bind_to_port.
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lambdai lambdai changed the title Fixduplicate Listener: fix a crash when updating any listener that does not bind to port Oct 5, 2021
@mandarjog
Copy link
Copy Markdown
Contributor

@lizan since this is blocking istio-proxy from picking up the change.

@mandarjog
Copy link
Copy Markdown
Contributor

ref: istio/istio#34188

@mattklein123 mattklein123 self-assigned this Oct 5, 2021
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks generally LGTM with small comments.

/wait

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 5, 2021

/retest

@repokitteh-read-only
Copy link
Copy Markdown

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #18421 (comment) was created by @lambdai.

see: more, trace.

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks, one question.

/wait-any

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@mattklein123
Copy link
Copy Markdown
Member

LGTM but unfortunately needs another main merge.

/wait

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 6, 2021

LGTM but unfortunately needs another main merge.

/wait

Thanks! Just did it

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 6, 2021

@mattklein123 Thank you for the fast and friendly collaboration!

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 6, 2021

I see conflict show up again at WebUI but my origin/main is updated. I will keep watch on this

@lizan
Copy link
Copy Markdown
Member

lizan commented Oct 6, 2021

@lambdai do we want to backport this to 1.20.x?

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 6, 2021

@lambdai do we want to backport this to 1.20.x?

yes, I plan to propose /backport when this is merged.

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 6, 2021

Should I do it earlier?

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 6, 2021

/backport

@repokitteh-read-only repokitteh-read-only bot added the backport/review Request to backport to stable releases label Oct 6, 2021
@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Oct 6, 2021

@lizan @mathetake This is 1.20 only and it's critical for istio release See istio/istio#34188

I can create the PR when this one is merged. WDTY?

@mattklein123 mattklein123 merged commit e84987c into envoyproxy:main Oct 7, 2021
@lambdai lambdai deleted the fixduplicate branch October 7, 2021 16:33
lambdai added a commit to lambdai/envoy-dai that referenced this pull request Oct 7, 2021
…o port (envoyproxy#18421)

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lizan
Copy link
Copy Markdown
Member

lizan commented Oct 7, 2021

@mathetake is OOO

Yes we should backport this to 1.20.x

mathetake pushed a commit that referenced this pull request Oct 18, 2021
…o port (#18421) (#18505)

backport e84987c to v1.20

Fix the crash caused by listener update when the any listener set bind_to_port to false.
A listener does not bind to port has no io handle. close() already check it.
Now add the check to isOpen().

Also the Tcp(or Udp)ListenSocket::duplicate() creates parent ListenSocketImpl
Make it returning the derived ListenSocket, either TcpListenSocket or UdpListenSocket

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@alyssawilk alyssawilk added backport/approved Approved backports to stable releases and removed backport/review Request to backport to stable releases labels Nov 29, 2021
aidanhahn pushed a commit to gravitee-io/envoy that referenced this pull request Jan 13, 2022
…o port (envoyproxy#18421) (envoyproxy#18505)

backport e84987c to v1.20

Fix the crash caused by listener update when the any listener set bind_to_port to false.
A listener does not bind to port has no io handle. close() already check it.
Now add the check to isOpen().

Also the Tcp(or Udp)ListenSocket::duplicate() creates parent ListenSocketImpl
Make it returning the derived ListenSocket, either TcpListenSocket or UdpListenSocket

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/approved Approved backports to stable releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants