-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 line container not found in logging api #6399
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…er: fa7802b2206f84f4f1e166a7a640523a281031c4c95d1709d38d62680391b97c
Codecov Report
@@ Coverage Diff @@
## main #6399 +/- ##
==========================================
- Coverage 70.38% 70.38% -0.01%
==========================================
Files 499 499
Lines 22722 22738 +16
==========================================
+ Hits 15994 16005 +11
- Misses 5685 5692 +7
+ Partials 1043 1041 -2
Continue to review full report at Codecov.
|
gsquared94
approved these changes
Aug 10, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
relates to GoogleCloudPlatform/cloud-code-intellij-internal#4323
follow from testing of #6370
When testing #6370, @etanshaul mentioned, he saw
ApplicationLogEvent
Steps to reproduce
1) Run the guestbook app (I used the Java one) 2) Introduce a build error (I made a compilation error in frontend) - let skaffold run and error out 3) Fix the error - let skaffold run 4) Make another change in frontend (one that doesn't break the build) and let skaffold run -> I see multiple frontend containers in app log eventsDescription of change:
After digging in the code, we stream container logs in pkg/skaffold/kubernetes/logger here https://github.com/GoogleContainerTools/skaffold/blob/main/pkg/skaffold/kubernetes/logger/log.go#L150
in
Logger.Start()
However, we never stop this process when a new dev iteration is starts. We only mute logs before a new dev iteration starts. Muting will make sure that no container logs are read and printed since that point of time.
Skaffold relies on the
kubectl logs
behaviour which exits when an error encounters.kubectl logs pod/xxx -c xxx -f
print linerpc error: code = Unknown desc = Error: No such container:
before exiting.We have a race condition here between
kubectl log
gets killed.If 1) happens before 2) then you don't see the
rpc error: code = Unknown desc = Error: No such container: fa7802b2206f84f4f1e166a7a640523a281031c4c95d1709d38d62680391b97c
line.If 2) happens before 1) then unfortunately this line will be read from log stream and relayed to event API
CLI Reproduction steps.
On master before this change,
skaffold dev
on any exampleIn this PR,
if log for a container are not found, we will ignore them.
Don't add containers to track if a pod is deleted so we don't stream logs for deleted pod, containers.
Follow up