Skip to content

connpool: Fix crash in pool removal if the cluster was already deleted#17522

Merged
ggreenway merged 1 commit intoenvoyproxy:mainfrom
ggreenway:fix-connpool-crash
Jul 28, 2021
Merged

connpool: Fix crash in pool removal if the cluster was already deleted#17522
ggreenway merged 1 commit intoenvoyproxy:mainfrom
ggreenway:fix-connpool-crash

Conversation

@ggreenway
Copy link
Member

Signed-off-by: Greg Greenway ggreenway@apple.com

Commit Message: The idle callback was incorrectly going through the
ThreadLocalClusterManagerImpl::ClusterEntry to reach the
ThreadLocalClusterManager. The pool is owned by the
ThreadLocalClusterManager, not by the ClusterEntry, so the reference
to the ClusterEntry could be dangling, resulting in a crash.

fixes commit #17403
Additional Description:
Risk Level: Low
Testing: Restored test that was incorrectly removed
Docs Changes: None
Release Notes: None
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]

The idle callback was incorrectly going through the
ThreadLocalClusterManagerImpl::ClusterEntry to reach the
ThreadLocalClusterManager. The pool is owned by the
ThreadLocalClusterManager, not by the ClusterEntry, so the reference
to the ClusterEntry could be dangling, resulting in a crash.

fixes commit envoyproxy#17403

Signed-off-by: Greg Greenway <ggreenway@apple.com>
@ggreenway
Copy link
Member Author

The changes to the test are just reverting (logically, after naming changes) removal of those bits in #17403 . I don't know why I removed that, but it was a necessary part of the test, and would have caught this.

Copy link
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.

Makes sense to me, thanks!

Copy link
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

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

LGTM though if possible to integration test this (even if race prone) please do as at least a follow-up. I think having more e2e coverage of this would be fantastic.

@ggreenway ggreenway merged commit fdd8606 into envoyproxy:main Jul 28, 2021
baojr added a commit to baojr/envoy that referenced this pull request Jul 29, 2021
…bridge-stream

* upstream/main: (140 commits)
  quiche: remove google quic support (envoyproxy#17465)
  runtime: removing envoy.reloadable_features.check_ocsp_policy (envoyproxy#17524)
  upstream: not trying to do HTTP/3 where not configured (envoyproxy#17454)
  api: Remove confusing line about auto-generation (envoyproxy#17536)
  v2: removing bootstrap (envoyproxy#17523)
  connpool: Fix crash in pool removal if the cluster was already deleted (envoyproxy#17522)
  Enhance the comments clearly (envoyproxy#17517)
  mysql proxy: connection attributes parsing  (envoyproxy#17209)
  [ci] fix false positive CVE scan from node (envoyproxy#17510)
  Fixing Envoy Mobile factory strings (envoyproxy#17509)
  http3: validating codec (envoyproxy#17452)
  quic: add QUIC upstream stream reset error stats (envoyproxy#17496)
  thrift proxy: move UpstreamRequest into its own file (envoyproxy#17498)
  docs: Fixed FaultDelay docs. (envoyproxy#17495)
  updates links to jaegertracing-plugin.tar.gz (envoyproxy#17497)
  http: make custom inline headers bootstrap configurable (envoyproxy#17330)
  deps: update yaml-cpp to latest master (envoyproxy#17489)
  improving tracer coverage (envoyproxy#17493)
  Increase buffer size of `Win32RedirectRecords` (envoyproxy#17471)
  ext_proc: Fix problem with buffered body mode with empty or no body (envoyproxy#17430)
  ...

Signed-off-by: Garrett Bourg <bourg@squareup.com>
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
envoyproxy#17522)

The idle callback was incorrectly going through the
ThreadLocalClusterManagerImpl::ClusterEntry to reach the
ThreadLocalClusterManager. The pool is owned by the
ThreadLocalClusterManager, not by the ClusterEntry, so the reference
to the ClusterEntry could be dangling, resulting in a crash.

fixes commit envoyproxy#17403

Signed-off-by: Greg Greenway <ggreenway@apple.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.

3 participants