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

Ensure agent is always set for mysql/grpc #343

Merged
merged 1 commit into from
Jan 12, 2017
Merged

Ensure agent is always set for mysql/grpc #343

merged 1 commit into from
Jan 12, 2017

Conversation

matthewloring
Copy link
Contributor

@matthewloring matthewloring commented Jan 12, 2017

If either of these modules switch to lazily importing any of our patched
files, we would fail to set the agent in some cases.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 12, 2017
@matthewloring matthewloring changed the title Set agent for client and server paths of grpc Ensure agent is always set for mysql/grpc Jan 12, 2017
If either of these modules switch to lazily importing any of our patched
files, we would fail to set the agent in some cases.
@matthewloring
Copy link
Contributor Author

PTAL

@kjin
Copy link
Contributor

kjin commented Jan 12, 2017

I'm not sure I understand what the impact of this change is. It seems like now agent is set only if it hasn't been set before, but does this necessarily make it any more certain that it's actually set?

@matthewloring
Copy link
Contributor Author

None of the code in these hooks can execute without a call to one of the patch functions. This change ensures that the first patch function called always sets agent as opposed to assuming that all patch functions are called before any other code in the hook file runs.

Copy link
Contributor

@kjin kjin left a comment

Choose a reason for hiding this comment

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

I see - I missed the addition of the agent assignment in the second patch function (for some reason I thought agent = agent_ was present there too). LGTM

@matthewloring matthewloring merged commit ca84959 into googleapis:master Jan 12, 2017
vmarchaud pushed a commit to keymetrics/origa that referenced this pull request Jan 16, 2017
If either of these modules switch to lazily importing any of our patched
files, we would fail to set the agent in some cases.

PR-URL: googleapis/cloud-trace-nodejs#343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants