Improve handling of progress conditions in non-polling fetch #19930
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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NTA2MjIsIm5iZiI6MTcxOTY1MDMyMiwicGF0aCI6Ii8zNDg3NjAwLzM0MTI2NDQxMy03NTE5OGE4MS05ZGYzLTQwZmMtOTdhMi0xNGQ2N2I5NGNiMGYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjlUMDgzODQyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDU4MTVlOGJjZGZkMmE1OTM3Mzg0MDc0MjlhMWYyMzNiOTYyOGY4MDZkYjQyN2EzNTYwY2RhODc3YzY4ZmViZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.5--0YlW8jfK8VwI-4aJWBe9IEse2yqPfyYZ53od2roo)
And then after this PR;
![image](https://private-user-images.githubusercontent.com/3487600/341253637-ae9ba45f-3c67-44d7-9fd2-10a758d59163.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NTA2MjIsIm5iZiI6MTcxOTY1MDMyMiwicGF0aCI6Ii8zNDg3NjAwLzM0MTI1MzYzNy1hZTliYTQ1Zi0zYzY3LTQ0ZDctOWZkMi0xMGE3NThkNTkxNjMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjlUMDgzODQyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjIxNDg2ZWUwODZkY2Y0OWZmNGFmZDI3ZTk0NmI1YTU0NzVkNDlkYzc4NmYzYmEwMmFiZmFjNWE4N2UyZTkyOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.VPQG01_VQM-3xLIDDNxr49NJXHS8DR3mGG6y4utgH4Y)
Backports Required
Release Notes