Skip to content

Commit

Permalink
[metadata] Don't ref entire read for unknown metadata added to hpack …
Browse files Browse the repository at this point in the history
…table (grpc#34863)
  • Loading branch information
ctiller authored Nov 2, 2023
1 parent b94e1ec commit edfb038
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/core/lib/experiments/experiments.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/core/lib/experiments/experiments.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/core/lib/experiments/experiments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@
expiry: 2024/02/01
owner: [email protected]
test_tags: [resource_quota_test]
- name: uniquely_unowned
description: Ensure HPACK table takes a unique copy of data when parsing unknown metadata
expiry: 2024/03/03
owner: [email protected]
- name: work_serializer_clears_time_cache
description:
Have the work serializer clear the time cache when it dispatches work.
Expand Down
2 changes: 2 additions & 0 deletions src/core/lib/experiments/rollouts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
default: false
- name: unconstrained_max_quota_buffer_size
default: false
- name: uniquely_unowned
default: true
- name: work_serializer_clears_time_cache
default: true
- name: work_serializer_dispatch
Expand Down
7 changes: 6 additions & 1 deletion src/core/lib/transport/metadata_batch.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <grpc/support/log.h>

#include "src/core/lib/compression/compression_internal.h"
#include "src/core/lib/experiments/experiments.h"
#include "src/core/lib/gprpp/chunked_vector.h"
#include "src/core/lib/gprpp/if_list.h"
#include "src/core/lib/gprpp/packed_table.h"
Expand Down Expand Up @@ -647,7 +648,11 @@ class ParseHelper {
absl::string_view key) {
return ParsedMetadata<Container>(
typename ParsedMetadata<Container>::FromSlicePair{},
Slice::FromCopiedString(key), std::move(value_), transport_size_);
Slice::FromCopiedString(key),
IsUniquelyUnownedEnabled() && will_keep_past_request_lifetime_
? value_.TakeUniquelyOwned()
: std::move(value_),
transport_size_);
}

private:
Expand Down

0 comments on commit edfb038

Please sign in to comment.