Skip to content

fix(grpc-transcode): pb_option should be set on the route#7116

Merged
spacewander merged 2 commits into
apache:masterfrom
spacewander:a7025
May 25, 2022
Merged

fix(grpc-transcode): pb_option should be set on the route#7116
spacewander merged 2 commits into
apache:masterfrom
spacewander:a7025

Conversation

@spacewander

Copy link
Copy Markdown
Member

Signed-off-by: spacewander [email protected]

Description

Fixes #7025

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@spacewander spacewander changed the title fix(grpc-transcode): pb_option should be be set on the route fix(grpc-transcode): pb_option should be set on the route May 24, 2022
@spacewander
spacewander marked this pull request as ready for review May 24, 2022 11:30

@bisakhmondal bisakhmondal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general look good to me. Thanks!

Comment on lines +64 to +70
table.sort(options)
for i, v in ipairs(options) do
if cur_opts[i] ~= v then
same = false
break
end
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume the extra check of pointer and values are for perf improvements. But just a small heads up, this check will fail on the second time the set_option method is called and on the first call, the cur_opts was nil.

In that scenario, at the first run, the unsorted table will be cached - L81.
L66 will try to match with the sorted table options.

Anyway, just a small nitpicking indeed : )

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch!

tokers
tokers previously approved these changes May 25, 2022
tzssangglass
tzssangglass previously approved these changes May 25, 2022
Signed-off-by: spacewander <[email protected]>
@spacewander
spacewander dismissed stale reviews from tzssangglass and tokers via 6085eb2 May 25, 2022 01:42

@bisakhmondal bisakhmondal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks!

@spacewander
spacewander merged commit d978605 into apache:master May 25, 2022
hongbinhsu pushed a commit to fitphp/apix that referenced this pull request May 25, 2022
* upstream/master:
  test: make sure the nginx.pid is written (apache#7122)
  fix(grpc-transcode): pb_option should be set on the route (apache#7116)
  feat(ops):   check dns resolver address is valid (apache#7079)
  fix: reduce memory usage when abnormal weights are given in chash (apache#7103)
spacewander added a commit that referenced this pull request Jun 30, 2022
Liu-Junlin pushed a commit to Liu-Junlin/apisix that referenced this pull request Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: grpc-transcode's pb_option is set on the proto level

5 participants