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(security): panic due to concurrent map write on handled go routine #92

Merged
merged 3 commits into from
Jul 9, 2022

Conversation

42atomys
Copy link
Owner

@42atomys 42atomys commented Jul 9, 2022

Relative Issues: Fixes #91

Describe the pull request

In really rare case, when multiples of request is performed on the same spec, an overlap of security pipeline cause a panic due to a concurrent map write. The same pipeline are used for the same spec.

Fixed it by set up a sync.RWMutex on pipeline to secure write on go routine and implement a DeepCopy to make each object individual

Checklist

  • I have linked the relative issue to this pull request
  • I have made the modifications or added tests related to my PR
  • I have added/updated the documentation for my RP
  • I put my PR in Ready for Review only when all the checklist is checked

Breaking changes ?
no

Additional context

@42atomys 42atomys linked an issue Jul 9, 2022 that may be closed by this pull request
1 task
@codecov
Copy link

codecov bot commented Jul 9, 2022

Codecov Report

Merging #92 (39c7d35) into main (dbf27d1) will increase coverage by 0.11%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #92      +/-   ##
==========================================
+ Coverage   93.97%   94.08%   +0.11%     
==========================================
  Files          22       22              
  Lines         962      981      +19     
==========================================
+ Hits          904      923      +19     
  Misses         39       39              
  Partials       19       19              
Impacted Files Coverage Δ
internal/server/v1alpha1/handlers.go 93.02% <100.00%> (+0.08%) ⬆️
pkg/factory/pipeline.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d21f17...39c7d35. Read the comment docs.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jul 9, 2022
@42atomys 42atomys merged commit 805accf into main Jul 9, 2022
@42atomys 42atomys deleted the 91-fix-go-routine-overflow-with-amqp branch July 9, 2022 00:23
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.

fix: go routine overflow with amqp
1 participant