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 log streaming issues #5104

Merged

Conversation

bisgaard-itis
Copy link
Contributor

@bisgaard-itis bisgaard-itis commented Nov 28, 2023

What do these changes do?

  • Refactor log streaming. Now there is a single wrapped RabbitMQ client (called the LogDistributor) which subscribes to the log exchange in the RabbitMQ services and distributes the logs from different jobs to the corresponding LogStreamers
  • When a request to the logstream endpoint is made a LogStreamer is constructed and it registers itself with the LogDistributor.
  • Add unit tests for having multiple users streaming at the same time and requesting the logstream multiple times.
  • I also allow an arbitrarily large queue in the LogStreamer as otherwise logs are lost when streaming. Seemingly that was the cause of Logs disappearing on their way from computational sidecar to api-server #5096

Related issue/s

How to test

Dev Checklist

DevOps Checklist

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Merging #5104 (dba4b44) into master (70efe70) will decrease coverage by 21.0%.
The diff coverage is 90.2%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5104      +/-   ##
=========================================
- Coverage    87.3%   66.4%   -21.0%     
=========================================
  Files        1267     596     -671     
  Lines       52079   29227   -22852     
  Branches     1129     198     -931     
=========================================
- Hits        45507   19424   -26083     
- Misses       6332    9753    +3421     
+ Partials      240      50     -190     
Flag Coverage Δ
integrationtests 64.8% <ø> (-0.1%) ⬇️
unittests 83.4% <90.2%> (-1.8%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...re_service_api_server/api/dependencies/rabbitmq.py 81.8% <100.0%> (-14.3%) ⬇️
...vice_api_server/api/routes/solvers_jobs_getters.py 81.2% <100.0%> (+0.2%) ⬆️
...src/simcore_service_api_server/core/application.py 97.3% <100.0%> (+0.1%) ⬆️
...c/simcore_service_api_server/models/basic_types.py 100.0% <100.0%> (ø)
.../simcore_service_api_server/models/schemas/jobs.py 96.5% <100.0%> (+<0.1%) ⬆️
...rc/simcore_service_api_server/services/rabbitmq.py 100.0% <100.0%> (ø)
...mcore_service_api_server/services/log_streaming.py 93.8% <93.8%> (ø)
...ervice_api_server/api/errors/log_handling_error.py 46.1% <46.1%> (ø)

... and 999 files with indirect coverage changes

@bisgaard-itis bisgaard-itis marked this pull request as ready for review November 29, 2023 09:32
@bisgaard-itis bisgaard-itis self-assigned this Nov 29, 2023
@bisgaard-itis bisgaard-itis added the a:apiserver api-server service label Nov 29, 2023
@bisgaard-itis bisgaard-itis added this to the Kobayashi Maru milestone Nov 29, 2023
Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

Great job. Left some comments for your consideration. We should also discuss about error handling at some point. We need to find a common policy for the api-server.

Copy link
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

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

supernice, thanks, I left some minor comments, good luck with this!

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

codeclimate bot commented Nov 30, 2023

Code Climate has analyzed commit dba4b44 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

🎉 great work!

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

just a few questions around. otherwise great. thanks!

@bisgaard-itis bisgaard-itis merged commit 5175164 into ITISFoundation:master Nov 30, 2023
@bisgaard-itis bisgaard-itis deleted the 5081-improve-log-streaming branch November 30, 2023 13:08
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Jan 8, 2024
33 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:apiserver api-server service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logs disappearing on their way from computational sidecar to api-server Minor issues with logstreaming
5 participants