Skip to content
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

config: add StopSignal #544

Merged
merged 1 commit into from
Feb 22, 2017
Merged

Conversation

runcom
Copy link
Member

@runcom runcom commented Jan 30, 2017

Close #541

@stevvooe @vbatts PTAL I probably forgot something

Signed-off-by: Antonio Murdaca runcom@redhat.com

@stevvooe
Copy link
Contributor

stevvooe commented Jan 30, 2017

LGTM

I am not sure if we should add StopTimeout, as well. StopSignal is fairly portable, but the timeout can be deployment specific.

Approved with PullApprove

@wking
Copy link
Contributor

wking commented Jan 30, 2017 via email

@runcom
Copy link
Member Author

runcom commented Jan 31, 2017

Updated schema-fs as well

@jonboulle
Copy link
Contributor

I am not sure if we should add StopTimeout, as well. StopSignal is fairly portable, but the timeout can be deployment specific.

what exactly are the criteria here? this seems a bit loose; I thought we were going from a versioned docker config type?

@philips
Copy link
Contributor

philips commented Jan 31, 2017

@runcom can you please list the valid strings in this field? And ideally write a test case?

@runcom
Copy link
Member Author

runcom commented Jan 31, 2017

@philips sure

@stevvooe
Copy link
Contributor

@jonboulle Portability is just a measure of whether config is made with respect to the internals of the image or the host environment. Specifying the stop signal for a process is going to operate regardless of host machine (on the same os), whereas stop timeout may be very specific to how a machine is configured or what it is running. From a docker perspective, stop timeout exists in the image config, but there could be an argument that this is host specific, hence not included here automatically. Granted, I am favoring caution here, as it is easy to add but impossible to remove.

It would be good for someone else to lodge an informed opinion here.

@runcom
Copy link
Member Author

runcom commented Feb 1, 2017

@philips updated

config.md Outdated
@@ -124,6 +124,10 @@ Note: Any OPTIONAL field MAY also be set to null, which is equivalent to being a
If there are no labels then this property MAY either be absent or an empty map.
Implementations that are reading/processing this configuration file MUST NOT generate an error if they encounter an unknown labels key.

- **StopSignal** *string*, OPTIONAL

The field contains the system call signal that will be sent to the container to exit. The signal can be a valid unsigned number that matches a position in the kernel’s syscall table, for instance `9`, or a signal name in the format `SIGNAME`, for instance `SIGKILL`.
Copy link
Contributor

@wking wking Feb 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we require the named version (e.g. SIGKILL) and not allow numbers (e.g. 9)? A fair number of names are portable across POSIX systems (and a handful are required by ISO C), but POSIX has very little to say about the semantics for a particular signal number (e.g. it does not require SIGKILL to be 9). And the Linux man page has:

Because the range of available real-time signals varies according to the glibc threading implementation… programs should never refer to real-time signals using hard-coded numbers, but instead should always refer to real-time signals using the notation SIGRTMIN+n

And more generally

Several signal numbers are architecture-dependent, as indicated in the "Value" column.

So using numbers is less portable for no obvious benefit (or maybe there is a benefit, and I'm just not seeing it?).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine using named signals - @stevvooe wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the posix constants: https://github.com/docker/docker/blob/dad8cbfc2d6db45331be2cbd8f9997ab0851fccf/container/container_unit_test.go#L29, as far as I can tell. These may be slightly platform specific, so I am not sure what constraints to apply, if any at all.

@jonboulle
Copy link
Contributor

jonboulle commented Feb 1, 2017

@stevvooe sorry, my question was imprecise - I meant criteria with respect to what fields we add to this config object at all, not about which are portable and which aren't. e.g. I thought this was basically https://github.com/docker/docker/blob/master/image/spec/v1.md#image-json-description , except now we're extending beyond that.

@stevvooe stevvooe mentioned this pull request Feb 10, 2017
@vbatts
Copy link
Member

vbatts commented Feb 13, 2017

god i hate this schema/fs.go file. It causes senseless number of rebases. ☹️

Can you rebase please?

@runcom
Copy link
Member Author

runcom commented Feb 13, 2017

@vbatts done!

@vbatts
Copy link
Member

vbatts commented Feb 13, 2017

LGTM

Approved with PullApprove

@stevvooe
Copy link
Contributor

@runcom Please rebase!

@runcom
Copy link
Member Author

runcom commented Feb 14, 2017

@stevvooe done

@philips
Copy link
Contributor

philips commented Feb 15, 2017

I still feel we shouldn't allow numbers unless there is a really good reason.

@stevvooe
Copy link
Contributor

I still feel we shouldn't allow numbers unless there is a really good reason.

@runcom Is this easy to do? If not, let me know and we can merge this and open an issue.

@runcom
Copy link
Member Author

runcom commented Feb 16, 2017

@runcom Is this easy to do? If not, let me know and we can merge this and open an issue.

I think it's fine, this is the spec and it's just wording afaict. I can drop the number stuff in the stop signal paragraph I guess. We can add numbers if there's a need to add them.

@runcom
Copy link
Member Author

runcom commented Feb 16, 2017

@philips @stevvooe updated

@runcom
Copy link
Member Author

runcom commented Feb 16, 2017

BTW, this is the original conversation when stopsignal was added in docker moby/moby#15307 (comment) and Dan raised the issue that matching syscall names against a table is often outdated. Not sure that's a real argument though, but still, something to consider when deciding to use numbers as well.

@stevvooe
Copy link
Contributor

BTW, this is the original conversation when stopsignal was added in docker moby/moby#15307 (comment) and Dan raised the issue that matching syscall names against a table is often outdated. Not sure that's a real argument though, but still, something to consider when deciding to use numbers as well.

I wonder if we could look these up dynamically.

@stevvooe
Copy link
Contributor

@runcom Looks like we require another rebase. Sorry.

@runcom runcom force-pushed the stop-signal branch 2 times, most recently from 66d9a11 to d5ab0e4 Compare February 17, 2017 11:18
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
@runcom
Copy link
Member Author

runcom commented Feb 17, 2017

Rebased

@stevvooe
Copy link
Contributor

stevvooe commented Feb 17, 2017

LGTM

Approved with PullApprove

@philips
Copy link
Contributor

philips commented Feb 18, 2017

LGTM

Approved with PullApprove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants