This repository was archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
exec should wait for shim #27
Merged
jodh-intel
merged 2 commits into
clearcontainers:master
from
dlespiau:20170410-exec-should-wait-for-shim
Apr 12, 2017
Merged
exec should wait for shim #27
jodh-intel
merged 2 commits into
clearcontainers:master
from
dlespiau:20170410-exec-should-wait-for-shim
Apr 12, 2017
Conversation
This file contains hidden or 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
Contributor
dlespiau
commented
Apr 10, 2017
jodh-intel
reviewed
Apr 11, 2017
| func (session *ioSession) WaitForShim() error { | ||
| select { | ||
| case <-session.shimConnected: | ||
| case <-time.After(waitForShimTimeout): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a reasonable timeout, but since it is a relatively long time, I think it could be useful to display a message every second or so that shows the status. Something like:
Waiting for shim to register itself with token %s (timeout in %d seconds)
That way, it'll be clear from the log what the proxy is doing and that it hasn't just "hung".
proxy_test.go
Outdated
| var wg sync.WaitGroup | ||
| wg.Add(1) | ||
| go func() { | ||
| time.Sleep(20 * time.Millisecond) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second occurence of 20 * time.Millisecond - might be worth a variable for this?
The two relocation handlers had some common code we could have factored out. We're going to add more common code, so may as well start by that. Note that this won't work if we ever need to support the createPod command with multiple containers, but that's not planned currently. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
I don't really want to have to queue stdout/err data in the proxy. To solve that, let's introduce a new constraint. The data path: shim <-> proxy <-> hyperstart has to be fully setup before we allow newcontainer/execmd to execute a new process. While we advise to start the shim as early as possible and issue the newcontainer/execcmd command after that, we need to synchronize somewhere. The easier way of doing that is to stall the newcontainer/execcmd commands until we see the corresponding shim registering itself. Fixes: clearcontainers#21 Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
ab74862 to
20b364a
Compare
Contributor
Author
|
PR updated:
|
1 similar comment
|
lgtm |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.