Skip to content

Add a couple of missing fields to StreamInfoImpl::setFrom#25864

Merged
ravenblackx merged 1 commit intoenvoyproxy:mainfrom
pksohn:streaminfo-bytessent
Mar 2, 2023
Merged

Add a couple of missing fields to StreamInfoImpl::setFrom#25864
ravenblackx merged 1 commit intoenvoyproxy:mainfrom
pksohn:streaminfo-bytessent

Conversation

@pksohn
Copy link
Copy Markdown
Contributor

@pksohn pksohn commented Mar 1, 2023

These were missed in #23648.

Commit Message: Add a couple of missing fields to StreamInfoImpl::setFrom
Risk Level: Low
Testing: Unit tested.
Docs Changes: N/A

Signed-off-by: Paul Sohn <paulsohn@google.com>
@pksohn
Copy link
Copy Markdown
Contributor Author

pksohn commented Mar 1, 2023

/assign @danzh2010

attempt_count_ = info.attemptCount();
upstream_bytes_meter_ = info.getUpstreamBytesMeter();
bytes_sent_ = info.bytesSent();
is_shadow_ = info.isShadow();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add some check or at least a comment in StreamInfo declaration about changing this place if new field is added?

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 am curious why the asserts in assertStreamInfoSize() of StreamInfoImplTest are not triggered then?

Is this because you fixed the asserts when you added them initially but forgot to add the copies in setFrom?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@danzh2010, as tyxia pointed out, assertStreamInfoSize is the intended mechanism for keeping this up to date if new fields are added.

@tyxia, that's right -- these fields were already there in streaminfo, but I didn't add them to this method initially.

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.

thanks for confirmation!

Copy link
Copy Markdown
Contributor

@danzh2010 danzh2010 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Member

@tyxia tyxia left a comment

Choose a reason for hiding this comment

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

lgtm

attempt_count_ = info.attemptCount();
upstream_bytes_meter_ = info.getUpstreamBytesMeter();
bytes_sent_ = info.bytesSent();
is_shadow_ = info.isShadow();
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.

thanks for confirmation!

@pksohn
Copy link
Copy Markdown
Contributor Author

pksohn commented Mar 2, 2023

@RyanTheOptimist any chance you could merge this?

@pksohn
Copy link
Copy Markdown
Contributor Author

pksohn commented Mar 2, 2023

or @alyssawilk?

@RyanTheOptimist
Copy link
Copy Markdown
Contributor

@RyanTheOptimist any chance you could merge this?

You'll probably want to use "/assign" to make sure PRs actually end up assigned. GitHub it so verbose with emails that it's easy to miss comments like this. sigh GitHub shake head

The change LGTM, but it needs cross-company review as well. I'll assign it to someone for that review.

@RyanTheOptimist
Copy link
Copy Markdown
Contributor

/assign @ravenblackx

@ravenblackx ravenblackx merged commit 5edc7f3 into envoyproxy:main Mar 2, 2023
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.

5 participants