Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep capacity when dropping pending reads in the stream channel #447

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/NIOHTTP2/HTTP2StreamChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ private extension HTTP2StreamChannel {
/// Drop all pending reads.
private func dropPendingReads() {
/// We don't need to report the dropped reads, just remove them all.
self.pendingReads.removeAll()
self.pendingReads.removeAll(keepingCapacity: true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we worry about this potentially keeping an unneeded/too-big capacity for the duration of the stream?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this is only called when the channel is closing.

}

/// Deliver all pending reads to the channel.
Expand Down
28 changes: 14 additions & 14 deletions docker/docker-compose.2204.510.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ services:
test:
image: swift-nio-http2:22.04-5.10
environment:
- MAX_ALLOCS_ALLOWED_1k_requests_inline_interleaved=34150
- MAX_ALLOCS_ALLOWED_1k_requests_inline_noninterleaved=33100
- MAX_ALLOCS_ALLOWED_1k_requests_interleaved=40150
- MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=39100
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response=286050
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response_inline=271050
- MAX_ALLOCS_ALLOWED_client_server_request_response=255050
- MAX_ALLOCS_ALLOWED_client_server_request_response_inline=246050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many=1200050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many_inline=891050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel=38050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline=38050
- MAX_ALLOCS_ALLOWED_1k_requests_inline_interleaved=33150
- MAX_ALLOCS_ALLOWED_1k_requests_inline_noninterleaved=32100
- MAX_ALLOCS_ALLOWED_1k_requests_interleaved=39150
- MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=38100
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response=284050
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response_inline=269050
- MAX_ALLOCS_ALLOWED_client_server_request_response=253050
- MAX_ALLOCS_ALLOWED_client_server_request_response_inline=244050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many=1198050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many_inline=889050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel=37050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline=37050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form=200050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace=200050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_long_string=300050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_short_string=200050
- MAX_ALLOCS_ALLOWED_hpack_decoding=5050
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=292650
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent_inline=291750
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=282650
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent_inline=281750
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error

shell:
Expand Down
28 changes: 14 additions & 14 deletions docker/docker-compose.2204.58.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ services:
test:
image: swift-nio-http2:22.04-5.8
environment:
- MAX_ALLOCS_ALLOWED_1k_requests_inline_interleaved=34150
- MAX_ALLOCS_ALLOWED_1k_requests_inline_noninterleaved=33100
- MAX_ALLOCS_ALLOWED_1k_requests_interleaved=40150
- MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=39100
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response=286050
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response_inline=271050
- MAX_ALLOCS_ALLOWED_client_server_request_response=255050
- MAX_ALLOCS_ALLOWED_client_server_request_response_inline=246050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many=1200050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many_inline=891050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel=38050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline=38050
- MAX_ALLOCS_ALLOWED_1k_requests_inline_interleaved=33150
- MAX_ALLOCS_ALLOWED_1k_requests_inline_noninterleaved=32100
- MAX_ALLOCS_ALLOWED_1k_requests_interleaved=39150
- MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=38100
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response=284050
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response_inline=269050
- MAX_ALLOCS_ALLOWED_client_server_request_response=253050
- MAX_ALLOCS_ALLOWED_client_server_request_response_inline=244050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many=1198050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many_inline=889050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel=37050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline=37050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form=200050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace=200050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_long_string=300050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_short_string=200050
- MAX_ALLOCS_ALLOWED_hpack_decoding=5050
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=292650
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent_inline=291750
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=282650
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent_inline=281750
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error

shell:
Expand Down
28 changes: 14 additions & 14 deletions docker/docker-compose.2204.59.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ services:
test:
image: swift-nio-http2:22.04-5.9
environment:
- MAX_ALLOCS_ALLOWED_1k_requests_inline_interleaved=34150
- MAX_ALLOCS_ALLOWED_1k_requests_inline_noninterleaved=33100
- MAX_ALLOCS_ALLOWED_1k_requests_interleaved=40150
- MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=39100
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response=286050
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response_inline=271050
- MAX_ALLOCS_ALLOWED_client_server_request_response=255050
- MAX_ALLOCS_ALLOWED_client_server_request_response_inline=246050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many=1200050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many_inline=891050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel=38050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline=38050
- MAX_ALLOCS_ALLOWED_1k_requests_inline_interleaved=33150
- MAX_ALLOCS_ALLOWED_1k_requests_inline_noninterleaved=32100
- MAX_ALLOCS_ALLOWED_1k_requests_interleaved=39150
- MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=38100
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response=284050
- MAX_ALLOCS_ALLOWED_client_server_h1_request_response_inline=269050
- MAX_ALLOCS_ALLOWED_client_server_request_response=253050
- MAX_ALLOCS_ALLOWED_client_server_request_response_inline=244050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many=1198050
- MAX_ALLOCS_ALLOWED_client_server_request_response_many_inline=889050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel=37050
- MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline=37050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form=200050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace=200050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_long_string=300050
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_short_string=200050
- MAX_ALLOCS_ALLOWED_hpack_decoding=5050
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=292650
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent_inline=291750
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=282650
- MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent_inline=281750
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error

shell:
Expand Down