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

[backend] Kill session on synchro when an HTTP error is send to client. (#7842) #7980

Merged
merged 4 commits into from
Aug 8, 2024

Conversation

aHenryJard
Copy link
Member

@aHenryJard aHenryJard commented Aug 7, 2024

Proposed changes

  • Kill session when an HTTP error is send back because EventSource that is used on syncManager closes the stream automatically on HTTP code that are different from 200 or 300 (redirects).

From my test locally, session flood can happen:

  • When remote OCTI stream sever is "running = false"
  • When user has not enough rights (marking, capacity or other checks on data)

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case (coverage and e2e)
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

@aHenryJard aHenryJard changed the title Kill session on synchro when an HTTP error is send to client. (#7842) [backend] Kill session on synchro when an HTTP error is send to client. (#7842) Aug 7, 2024
@aHenryJard aHenryJard added the filigran team use to identify PR from the Filigran team label Aug 7, 2024
@aHenryJard aHenryJard added this to the Release 6.3.0 milestone Aug 7, 2024
@aHenryJard aHenryJard marked this pull request as ready for review August 7, 2024 14:00
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 67.88%. Comparing base (eebee14) to head (46a4086).
Report is 7 commits behind head on master.

Files Patch % Lines
...tform/opencti-graphql/src/graphql/sseMiddleware.js 0.00% 32 Missing ⚠️
...latform/opencti-graphql/src/manager/syncManager.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7980      +/-   ##
==========================================
- Coverage   67.90%   67.88%   -0.02%     
==========================================
  Files         571      571              
  Lines       70811    70827      +16     
  Branches     6048     6049       +1     
==========================================
- Hits        48082    48080       -2     
- Misses      22729    22747      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aHenryJard aHenryJard merged commit e53d704 into master Aug 8, 2024
5 checks passed
@SouadHadjiat SouadHadjiat deleted the issue/7842-synchro-kill-session branch August 8, 2024 13:45
@SamuelHassine SamuelHassine added the solved use to identify issue that has been solved (must be linked to the solving PR) label Aug 9, 2024
@SamuelHassine SamuelHassine removed this from the Release 6.3.0 milestone Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team solved use to identify issue that has been solved (must be linked to the solving PR)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Platform is flooded with sessions when stopping a stream consumed by other remote platforms
3 participants