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

Use copy on write collection for tracking stored files #1708

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

fractalwrench
Copy link
Contributor

Goal

Tracing of the delivery layer from flaky tests indicates that the payload store is erroneously telling the scheduling service that 0 payloads are persisted on disk. I'm suspicious that this might be due to the implementation of storedFiles in getPayloadByPriority as it uses a ConcurrentSkipListSet, whose operations are async. I'd hypothesise that in our tests and also in prod this can result in a race condition where payloads aren't delivered by the scheduling service on the first attempt (although subsequent attempts do result in delivery).

Altering the implementation to use CopyOnWriteArraySet should fix this if the theory is correct.

Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.18%. Comparing base (341006b) to head (29709ee).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1708   +/-   ##
=======================================
  Coverage   84.17%   84.18%           
=======================================
  Files         457      457           
  Lines       10676    10674    -2     
  Branches     1606     1606           
=======================================
- Hits         8987     8986    -1     
  Misses        957      957           
+ Partials      732      731    -1     
Files with missing lines Coverage Δ
...rnal/delivery/storage/PayloadStorageServiceImpl.kt 80.00% <100.00%> (-0.52%) ⬇️

... and 1 file with indirect coverage changes

---- 🚨 Try these New Features:

Copy link
Collaborator

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

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

LGTM

@fractalwrench fractalwrench merged commit 2b67aa7 into main Nov 21, 2024
7 checks passed
@fractalwrench fractalwrench deleted the alter-stored-file-impl branch November 21, 2024 16:34
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.

2 participants