-
-
Notifications
You must be signed in to change notification settings - Fork 452
fix(transport): Tag sockets traffic originating from Sentry's HttpConnection #4340
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
Conversation
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
Performance metrics 🚀
|
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
|
||
@Override | ||
public void tagSockets() { | ||
TrafficStats.setThreadStatsTag(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to have the current thread id as tag?
I see the value in not showing the violation, but if we want to tackle it, we can show the current thread id or a number hardly used by the user, to ensure we don't mess with any report of the app.
Also, we could use TrafficStats.getAndSetThreadStatsTag()
, so that we can restore previous value, and if it's -1 clear it later. Not sure how much worth it is, as we are the only one using this thread, i think, but why not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if it'd change much because it's a threadlocal (under-the-hood) and we anyway use only our own single thread for our requests. But I changed it from 1 to a random number, I think it should be fine like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small comment on the number used to tag, but no strong opinion on it
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
📜 Description
To get rid of UntaggedSocket strict mode violation
💡 Motivation and Context
Addresses #909
💚 How did you test it?
With tests and verified no strict mode violation when running the sample app
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps