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

don't block events loop collecting logs #10493

Merged
merged 1 commit into from Apr 25, 2023
Merged

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Apr 24, 2023

What I did
as a new/restarted container is detected by watchContainers, the event handler must return ASAP otherwise the event loop is blocked. So logContainers must run in a goroutine in error group, with other log collectors

Related issue
fixes #10480
https://docker.atlassian.net/browse/ENV-175

(not mandatory) A picture of a cute animal, if possible in relation to what you did

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof ndeloof requested review from a team, nicksieger, StefanScherer, ulyssessouza, glours, milas and laurazard and removed request for a team April 24, 2023 09:50
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.02 ⚠️

Comparison is base (7b0ed13) 59.90% compared to head (de6d34a) 59.89%.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2   #10493      +/-   ##
==========================================
- Coverage   59.90%   59.89%   -0.02%     
==========================================
  Files         105      105              
  Lines        9056     9058       +2     
==========================================
  Hits         5425     5425              
- Misses       3066     3068       +2     
  Partials      565      565              
Impacted Files Coverage Δ
pkg/compose/logs.go 39.04% <0.00%> (-0.76%) ⬇️

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 in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

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

Tested locally and LGTM


I feel like we need to refactor some of this in the future -- I cannot actually follow the logic here, we've got multiple levels of errgroup::Go() calls happening across callback boundaries, for example

@ndeloof ndeloof merged commit dec608f into docker:v2 Apr 25, 2023
22 of 24 checks passed
@ndeloof ndeloof deleted the incomplete_logs branch April 25, 2023 13:20
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.

[BUG] Incomplete logs when "docker compose logs > filename &" is used and services are started one by one
3 participants