-
Notifications
You must be signed in to change notification settings - Fork 881
Conversation
ebb3714
to
b32937c
Compare
/cc @euank |
Add to the list of tests:
Although with this change |
gah, thanks for the follow-up, I need to implement more functional tests :-/ |
@euank while I am writing the tests, do you mind to provide the sequence that reproduces the issue for you? At least the following works for me:
|
It looks like it only happens if the app crashes, not if rkt stops it. @s-urbaniak I can repro it with the same commands as #3472 for setup, and then the following: $ rkt app status $(cat /tmp/uuid) --app=busybox
name=busybox
state=exited
image_id=sha512-060ab846247313a0aa120aa60761a2beb2080e1392c2969631f8caa7aa7d1597
created_at=2016-12-19 11:51:45.373342304 -0800 PST
started_at=2016-12-19 11:51:55.273725672 -0800 PST
finished_at=2016-12-19 11:51:55.493734411 -0800 PST
exit_code=127
$ rkt app rm $(cat /tmp/uuid) --app=busybox
rm: error removing app: error executing stage1 entrypoint: app-rm: cleanup error: app "busybox" is still running
$ rkt app stop $(cat /tmp/uuid) --app=busybox
$ echo $?
0
$ rkt app rm $(cat /tmp/uuid) --app=busybox
rm: error removing app: error executing stage1 entrypoint: app-rm: cleanup error: app "busybox" is still running |
@euank 👍 now I can reproduce this now, thanks a lot. Current mode: investigating, fixing, writing tests. |
Currently the sandbox follows the same semantic rule as an immutable pod. As soon as an app fails, it quits immediately. This behavior does not hold for mutable sandboxes. As soon as an app fails the sandbox needs to stay alive but track the exit code of the failed app appropriately. Also in case of restarts the /rkt/status files need to be readjusted. This fixes it. Also fixes rkt#3472
Currently if a sandbox app failed, it cannot be removed because it is assumed to be still running. This fixes it.
Currently if `rkt app --debug` is enabled we get stage1 debug output only if an error occurs. This fixes it by printing debug output always if it is enabled.
Currently we have mixture of file and directory conventions for app subcommands in stage0 and stage1. This fixes it by consolidating them following Go standards (underscore delimiters in filenames).
b32937c
to
12f92f4
Compare
@euank still writing the final functional tests, but do you mind to quickly verify if removing failed apps is fixed now? |
This simplifies the sandbox tests.
12f92f4
to
1a72e2a
Compare
Indeed, works as far as I can tell, thanks @s-urbaniak |
This adds more functional tests for the app sandbox. It adds a test which starts/stops an app within a running sandbox and another test which adds three different kinds of apps and evaluates their respective status in rkt.
869189b
to
a11d199
Compare
This PR will expose some logic flaws in some status code. For example, the API service assumes that if a pod is running, all apps are running. |
I like that you cleaned up some of the stage0 files. Did you change any of the behavior, or just shuffle code? |
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.
LGTM (one question inline, but really just a nit and I'm fine to land it as is).
@@ -107,7 +107,10 @@ func cleanupStage0(appName *types.ACName, enterCmd []string) error { | |||
// rely only on the output, since is-active returns non-zero for inactive units | |||
out, _ := cmd.Output() | |||
|
|||
if string(out) != "inactive\n" { | |||
switch string(out) { | |||
case "failed\n": |
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.
Is there a reason why we don't TrimRight
here?
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.
No, just pure sloppiness, I will address this in a follow-up.
Currently the sandbox follows the same semantic rule as an immutable
pod. As soon as an app fails, it quits immediately.
This behavior does not hold for mutable sandboxes. As soon as an app
fails the sandbox needs to stay alive but track the exit code of the
failed app appropriately.
Also in case of restarts the /rkt/status files need to be readjusted.
This fixes it.
Also fixes #3472
TODOs: