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

Improve batch upload wait timeout handling #1182

Conversation

0xnm
Copy link
Member

@0xnm 0xnm commented Dec 8, 2022

What does this PR do?

This change improves lock handling scenario in the batch upload. Before, if any exception would happen during the batch upload if Storage#readNextBatch is async (which is not the case right now), lock would be removed only after timeout. Now lock is removed immediately.

This is mostly a safeguard if at any point Storage#readNextBatch becomes async, but we probably need to revert the switch to async-like API in the upload pipeline back to the blocking API, because async one doesn't really bring any benefit and actually makes code more complex.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@0xnm 0xnm requested a review from a team as a code owner December 8, 2022 16:55
@codecov-commenter
Copy link

Codecov Report

Merging #1182 (c6f156a) into develop (84835ea) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop    #1182      +/-   ##
===========================================
+ Coverage    82.25%   82.28%   +0.03%     
===========================================
  Files          353      353              
  Lines        11777    11780       +3     
  Branches      2005     2006       +1     
===========================================
+ Hits          9686     9692       +6     
- Misses        1474     1475       +1     
+ Partials       617      613       -4     
Impacted Files Coverage Δ
...v2/core/internal/data/upload/DataUploadRunnable.kt 98.08% <100.00%> (-1.92%) ⬇️
...android/log/internal/logger/TelemetryLogHandler.kt 85.71% <0.00%> (-14.29%) ⬇️
.../kotlin/com/datadog/android/v2/core/DatadogCore.kt 88.94% <0.00%> (-1.38%) ⬇️
.../android/rum/internal/monitor/DatadogRumMonitor.kt 92.22% <0.00%> (-0.56%) ⬇️
...android/rum/internal/ndk/DatadogNdkCrashHandler.kt 86.70% <0.00%> (-0.49%) ⬇️
...in/com/datadog/android/log/internal/LogsFeature.kt 88.71% <0.00%> (ø)
...n/com/datadog/android/v2/core/SdkInternalLogger.kt 80.77% <0.00%> (ø)
.../android/rum/internal/domain/scope/RumViewScope.kt 95.24% <0.00%> (ø)
...android/v2/core/internal/DatadogContextProvider.kt 81.54% <0.00%> (ø)
... and 5 more

@0xnm 0xnm merged commit b37b44f into develop Dec 9, 2022
@0xnm 0xnm deleted the nogorodnikov/improve-batch-wait-timeout-handling-for-the-batch-upload branch December 9, 2022 10:27
@xgouchet xgouchet added this to the 1.16.0 milestone Dec 13, 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.

4 participants