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

fix(batchrouter): concurrent modification of job parameters causes panic #2631

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

atzoum
Copy link
Contributor

@atzoum atzoum commented Oct 31, 2022

Description

  1. Grouping jobs by destination before sending to workers, to avoid filtering at worker.
  2. Introducing lo, a generics library for streamlining operations on collections.

Notion Ticket

Link

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

wg.Add(1)
brt.processQ <- &BatchDestinationDataT{batchDestination: *batchDest, jobs: destJobs, parentWG: &wg}
} else {
brt.logger.Errorf("BRT: %s: Destination %s not found in destinationsMap", brt.destType, destID)
Copy link
Member

Choose a reason for hiding this comment

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

Although not relevant to this pr, we should do something about jobs of destination not found in destinationsMap. Abort?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can happen also as a side-effect of not being able to unmarshall parameters. Apart from that, yes I agree we should have some (safe) strategy for handling jobs of deleted destinations both in router & batch router.

@codecov
Copy link

codecov bot commented Oct 31, 2022

Codecov Report

Base: 44.09% // Head: 44.02% // Decreases project coverage by -0.06% ⚠️

Coverage data is based on head (702c337) compared to base (b6ce9b9).
Patch coverage: 55.55% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2631      +/-   ##
==========================================
- Coverage   44.09%   44.02%   -0.07%     
==========================================
  Files         187      187              
  Lines       39255    39234      -21     
==========================================
- Hits        17308    17274      -34     
- Misses      20843    20851       +8     
- Partials     1104     1109       +5     
Impacted Files Coverage Δ
router/batchrouter/batchrouter.go 33.87% <55.55%> (-0.27%) ⬇️
enterprise/reporting/setup.go 38.09% <0.00%> (-14.29%) ⬇️
utils/httputil/server.go 80.76% <0.00%> (-11.54%) ⬇️
config/backend-config/namespace_config.go 70.83% <0.00%> (-3.13%) ⬇️
enterprise/suppress-user/suppressUser.go 79.26% <0.00%> (-1.83%) ⬇️
enterprise/reporting/reporting.go 8.33% <0.00%> (-1.44%) ⬇️
services/rsources/handler.go 69.72% <0.00%> (-1.39%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants