diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 8c4bb04b2ba0..c6f50f8352fb 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -33,7 +33,7 @@ jobs: publish_results: true - name: "Upload artifact" - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: SARIF file path: results.sarif diff --git a/source/common/http/conn_pool_grid.cc b/source/common/http/conn_pool_grid.cc index ba51e7eee7e1..07b9bde9c618 100644 --- a/source/common/http/conn_pool_grid.cc +++ b/source/common/http/conn_pool_grid.cc @@ -191,6 +191,9 @@ void ConnectivityGrid::WrapperCallbacks::cancelAllPendingAttempts( absl::optional ConnectivityGrid::WrapperCallbacks::tryAnotherConnection() { + if (grid_.destroying_) { + return {}; + } absl::optional next_pool = grid_.nextPool(current_); if (!next_pool.has_value()) { // If there are no other pools to try, return an empty optional. @@ -236,10 +239,10 @@ ConnectivityGrid::ConnectivityGrid( ConnectivityGrid::~ConnectivityGrid() { // Ignore idle callbacks while the pools are destroyed below. destroying_ = true; - // Callbacks might have pending streams registered with the pools, so cancel and delete - // the callback before deleting the pools. - wrapped_callbacks_.clear(); + // Make sure to clear the pools (which deletes all active connections, and + // signals callers) before deleting callbacks. pools_.clear(); + wrapped_callbacks_.clear(); } void ConnectivityGrid::deleteIsPending() {