-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cue: handle signals and perform a graceful shutdown for mod registry
The registry did not handle signals. The default behavior of a Go program for receiving `SIGINT` and `SIGTERM` signals is to exit and return `128 + <signal number>`, regardless of whether it exits successfully or not. Handle signals and perform a graceful shutdown for the registry. Return zero when it exits successfully. Fixes #3224 Change-Id: I90a534d47f43b2d9f93db7f460df8892a695f134 Signed-off-by: haoqixu <[email protected]> Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196370 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
- Loading branch information
Showing
2 changed files
with
46 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# TODO: use a random unused port | ||
env CUE_REGISTRY=localhost:41331 | ||
exec cue mod registry ${CUE_REGISTRY} & | ||
exec cue mod publish v0.0.1 | ||
cmpenv stdout expect-stdout | ||
|
||
-- expect-stdout -- | ||
published mod.example/[email protected] to ${CUE_REGISTRY}/mod.example/blah:v0.0.1 | ||
-- blah.cue -- | ||
package blah | ||
blah: 42 | ||
-- cue.mod/module.cue -- | ||
module: "mod.example/blah@v0" | ||
language: { | ||
version: "v0.9.0" | ||
} | ||
source: { | ||
kind: "self" | ||
} |