Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Envelopes that fail to send are now flushed when the transport recovers #3438
Envelopes that fail to send are now flushed when the transport recovers #3438
Changes from 22 commits
d2d074b
eae7ef2
fb1128b
36351d8
3d1fc34
fe24b77
2e0b986
80461ca
db9e146
19a81fe
ed91bb2
9d8e4c0
95bcd42
92e45aa
ea92966
fc2a3d7
07db2f7
a57ed92
465795b
49a1893
238393e
2cd2302
5a426fd
53ef780
f359140
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This argument has a default value but I don't see it being tested when a cancellation token is passed.
If one is passed, and triggered,
Delay
would throw an exception that isnt' handled anywhere here. Is that considered?I'd recommend remove the argument if we're not using anywhere (at least I can't see it being used).
If we're using it, add a test that does that to verify the behavior
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.
Good call. Added test and modified code to ensure a graceful exit if the task is cancelled:
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.
I take it the new TcpClient every 500ms is not an issue?
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.
It won't be every 500ms due to the progressive backoff. There would be a first attempt, a subsequent attempts after 500ms, then 1000ms then 2000ms etc.
We could try to use the same TcpClient but it would need to be reset to be usable again after each unsuccessful connection attempt. I could do some benchmarks to check those two different approaches. It's worth noting that there will only be one
PollingNetworkStatusListener
instance in the application though, so I don't think this is really a hot path.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.
What does this mean in practice? Did we document in what environments this will work and which ones it wont?
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.
It's the flip side to this:
sentry-dotnet/src/Sentry.Maui/Internal/SentryMauiOptionsSetup.cs
Lines 54 to 57 in b76d536
With
PLATFORM_NEUTRAL
being defined here.In practice, I think that means if you lose network connectivity and then regain it again, and you're targeting one of those platforms specifically but you're not using MAUI, then any envelopes that you tried to send while the network was down won't be sent until you restart the application again.
Another option would be to always initialise the
SentryOptions.NetworkStatusListener
to anew PollingNetworkStatusListener
but let theSentryMauiOptionsSetup
override this... or some variant of that. TechnicallySentryOptions.NetworkStatusListener
is public so the user could set this to some custom listener that they've crafted. We don't currently do anything to make sure we don't override the user's listener if they've already set one.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.
Have created #3510 to track this conversation in any case (this PR is closed/merged so easy for the conversation to get lost here).
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.
I think that's the crux. But if we set it up in the option's constructor the user would overwrite it again and we'd be fine, right?