-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stage1: getPID: move the logic back to stage1
Move the pid logic back to stage1/rootfs/enter/enter.c (revert part of rkt#826), so the pid logic is an implementation detail of stage1, as it does not appear in Documentation/devel/stage1-implementors-guide.md Some stage1 might not have pid: stage1 based on virtual machines. See rkt#910 and rkt#826 Tests: there are no functional tests to check that the race in rkt#826 is correctly fixed. However, I tested manually in the following way: * Test rkt#1: 1. Start a pod: sudo bin/rkt --debug --insecure-skip-verify run --interactive docker://busybox 2. Pretend that rkt is slow and the ppid file is not yet written: cd /var/lib/rkt/pods/run/$uuid && mv ppid ppid-disabled 3. Enter the pod: sudo bin/rkt enter abbc9f3d /bin/sh 4. Notice that the enter command is waiting (without taking much cpu) 5. Pretend that rkt finished its job: cd /var/lib/rkt/pods/run/$uuid && mv ppid-disabled ppid 6. Notice that the enter command succeeds * Test rkt#2: 1. Repeat steps 1-4 from test rkt#1 2. Stop the pod: ^]^]^] 3. Notice that the enter command stops too FIXME: does not work yet * Test rkt#3: 1. patch stage1/init/init.go: + ioutil.WriteFile("/tmp/rkt-waiting", []byte(""), 0644) + for { + if _, err := os.Stat("/tmp/rkt-waiting"); os.IsNotExist(err) { + break + } + time.Sleep(100 * time.Millisecond) + } 2. Start a pod 3. Enter the pod 4. Notice that the enter command is waiting (without taking much cpu) 5. Let nspawn start: rm /tmp/rkt-waiting 6. Notice that the enter command succeeds
- Loading branch information
Showing
5 changed files
with
120 additions
and
71 deletions.
There are no files selected for viewing
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
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
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
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
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