Improve handling of progress conditions in non-polling fetch #19930
+33
−27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The use of
ss::when_any
andss::promise<>
for each progress condition resulted in unneeded allocations as well as expensive broken promises and exception propagation. This commit changes all progress conditions to signal the samess::condition_variable
instead. This simplifies their handling and greatly reduces their cost.The profile for progress conditions before this PR;
![image](https://private-user-images.githubusercontent.com/3487600/341264413-75198a81-9df3-40fc-97a2-14d67b94cb0f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4OTUxNzMsIm5iZiI6MTcxOTg5NDg3MywicGF0aCI6Ii8zNDg3NjAwLzM0MTI2NDQxMy03NTE5OGE4MS05ZGYzLTQwZmMtOTdhMi0xNGQ2N2I5NGNiMGYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDJUMDQzNDMzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2U3ZWU4ZDg2ZjZkZjE1ZDU3YjIzMzUzOTNjMDc2YzIzOTViMGVmNjc3Mzc4MjllZWUwM2M5NTJlYmI1M2M3MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.T8bC_p6H0A-qkfR304lZxic5fQDLBaOibZt6aR-zYoY)
And then after this PR;
![image](https://private-user-images.githubusercontent.com/3487600/341253637-ae9ba45f-3c67-44d7-9fd2-10a758d59163.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4OTUxNzMsIm5iZiI6MTcxOTg5NDg3MywicGF0aCI6Ii8zNDg3NjAwLzM0MTI1MzYzNy1hZTliYTQ1Zi0zYzY3LTQ0ZDctOWZkMi0xMGE3NThkNTkxNjMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDJUMDQzNDMzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzQ4NTVlM2E1YWZkYTk4ZjEyNWZjNWE2NWQ2YTdhNzdlOWM2YzAyMTY3MDEyMjNmMjRjYzQ2ZWYzNWI1OTZkMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.MQv32J2N5zbJQCId2AKsJS2AD-6k-k4XpT1yCbEnsfM)
Backports Required
Release Notes