Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit fixes a panic in `scylla::transport::speculative_execution::execute`. It is possible for all speculative fibers to finish without returning from the function. In that situation `select!` macro will panic because all futures passed to it are completed. Consider the scenario where all executions return BrokenConnection: we will only assign to last_error and never return. There are more ways that this bug can happen, but this is the simplest one to explain and reproduce. This commit fixes the bug by simplifying the logic inside the function. The new logic always checks if the resolved task is the last one, and if so it returns, so it's not possible for executions to be exhausted when calling `select!`.
- Loading branch information