fix(apiserver): validate, default and document job.terminate_interval (bug-1957)

The loader now stores the effective interval (10 s when unset or 0, LSF's
JOB_TERMINATE_INTERVAL default) and refuses a negative one; app_schema.json
describes the setting; src/docs/xce.md documents kill/stop behaviour and
the interval.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-10 10:04:47 +00:00
parent 73fe8f787c
commit 97f7c800f1
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
4 changed files with 59 additions and 0 deletions

View file

@ -247,6 +247,9 @@ func InitConf() error {
if terminateInterval < 0 {
return fmt.Errorf("job.terminate_interval must not be negative: %d", terminateInterval)
}
if terminateInterval == 0 {
terminateInterval = defaultTerminateInterval
}
JobYamlConfig = &JobConfig{
MaxArraySize: maxArraySize,
TerminateInterval: terminateInterval,
@ -316,6 +319,9 @@ func ParseMaxSize(maxSize string) (int64, error) {
}
const (
// defaultTerminateInterval is used when job.terminate_interval is unset
// or 0: LSF's JOB_TERMINATE_INTERVAL default (bug-1957).
defaultTerminateInterval = 10
// defaultMaxArraySize is used when job.max_array_size is unset or 0.
defaultMaxArraySize = 1000
// supportedMaxArraySize is the largest array the API server creates