Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
371091c8
Commit
371091c8
authored
20 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Add test for sigwait returning EINTR.
parent
5da4ec06
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/slurmctld/backup.c
+8
-6
8 additions, 6 deletions
src/slurmctld/backup.c
src/slurmctld/controller.c
+7
-5
7 additions, 5 deletions
src/slurmctld/controller.c
with
15 additions
and
11 deletions
src/slurmctld/backup.c
+
8
−
6
View file @
371091c8
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002 The Regents of the University of California.
* Copyright (C) 2002 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Mo
e
Jette <jette@llnl.gov>, Kevin Tew <tew1@llnl.gov>, et. al.
* Written by Mo
rris
Jette <jette@llnl.gov>, Kevin Tew <tew1@llnl.gov>, et. al.
* UCRL-CODE-2002-040.
* UCRL-CODE-2002-040.
*
*
* This file is part of SLURM, a resource management program.
* This file is part of SLURM, a resource management program.
...
@@ -170,7 +170,7 @@ void run_backup(void)
...
@@ -170,7 +170,7 @@ void run_backup(void)
* backup controller */
* backup controller */
static
void
*
_background_signal_hand
(
void
*
no_data
)
static
void
*
_background_signal_hand
(
void
*
no_data
)
{
{
int
sig
,
error_code
;
int
sig
,
rc
;
sigset_t
set
;
sigset_t
set
;
/* Locks: Write configuration, job, node, and partition */
/* Locks: Write configuration, job, node, and partition */
slurmctld_lock_t
config_write_lock
=
{
slurmctld_lock_t
config_write_lock
=
{
...
@@ -188,7 +188,9 @@ static void *_background_signal_hand(void *no_data)
...
@@ -188,7 +188,9 @@ static void *_background_signal_hand(void *no_data)
while
(
slurmctld_config
.
shutdown_time
==
0
)
{
while
(
slurmctld_config
.
shutdown_time
==
0
)
{
xsignal_sigset_create
(
backup_sigarray
,
&
set
);
xsignal_sigset_create
(
backup_sigarray
,
&
set
);
sigwait
(
&
set
,
&
sig
);
rc
=
sigwait
(
&
set
,
&
sig
);
if
(
rc
==
EINTR
)
continue
;
switch
(
sig
)
{
switch
(
sig
)
{
case
SIGINT
:
/* kill -2 or <CTRL-C> */
case
SIGINT
:
/* kill -2 or <CTRL-C> */
case
SIGTERM
:
/* kill -15 */
case
SIGTERM
:
/* kill -15 */
...
@@ -205,10 +207,10 @@ static void *_background_signal_hand(void *no_data)
...
@@ -205,10 +207,10 @@ static void *_background_signal_hand(void *no_data)
* restart the (possibly new) plugin.
* restart the (possibly new) plugin.
*/
*/
lock_slurmctld
(
config_write_lock
);
lock_slurmctld
(
config_write_lock
);
error_code
=
read_slurm_conf
(
0
);
rc
=
read_slurm_conf
(
0
);
if
(
error_code
)
if
(
rc
)
error
(
"read_slurm_conf: %s"
,
error
(
"read_slurm_conf: %s"
,
slurm_strerror
(
error_code
));
slurm_strerror
(
rc
));
else
{
else
{
/* Leave config lock set through this */
/* Leave config lock set through this */
_update_cred_key
();
_update_cred_key
();
...
...
This diff is collapsed.
Click to expand it.
src/slurmctld/controller.c
+
7
−
5
View file @
371091c8
...
@@ -371,7 +371,7 @@ static void _init_config(void)
...
@@ -371,7 +371,7 @@ static void _init_config(void)
static
void
*
_slurmctld_signal_hand
(
void
*
no_data
)
static
void
*
_slurmctld_signal_hand
(
void
*
no_data
)
{
{
int
sig
;
int
sig
;
int
error_code
;
int
rc
;
int
sig_array
[]
=
{
SIGINT
,
SIGTERM
,
SIGHUP
,
SIGABRT
,
0
};
int
sig_array
[]
=
{
SIGINT
,
SIGTERM
,
SIGHUP
,
SIGABRT
,
0
};
sigset_t
set
;
sigset_t
set
;
/* Locks: Read configuration */
/* Locks: Read configuration */
...
@@ -400,7 +400,9 @@ static void *_slurmctld_signal_hand(void *no_data)
...
@@ -400,7 +400,9 @@ static void *_slurmctld_signal_hand(void *no_data)
while
(
1
)
{
while
(
1
)
{
xsignal_sigset_create
(
sig_array
,
&
set
);
xsignal_sigset_create
(
sig_array
,
&
set
);
sigwait
(
&
set
,
&
sig
);
rc
=
sigwait
(
&
set
,
&
sig
);
if
(
rc
==
EINTR
)
continue
;
switch
(
sig
)
{
switch
(
sig
)
{
case
SIGINT
:
/* kill -2 or <CTRL-C> */
case
SIGINT
:
/* kill -2 or <CTRL-C> */
case
SIGTERM
:
/* kill -15 */
case
SIGTERM
:
/* kill -15 */
...
@@ -417,10 +419,10 @@ static void *_slurmctld_signal_hand(void *no_data)
...
@@ -417,10 +419,10 @@ static void *_slurmctld_signal_hand(void *no_data)
* restart the (possibly new) plugin.
* restart the (possibly new) plugin.
*/
*/
lock_slurmctld
(
config_write_lock
);
lock_slurmctld
(
config_write_lock
);
error_code
=
read_slurm_conf
(
0
);
rc
=
read_slurm_conf
(
0
);
if
(
error_code
)
if
(
rc
)
error
(
"read_slurm_conf: %s"
,
error
(
"read_slurm_conf: %s"
,
slurm_strerror
(
error_code
));
slurm_strerror
(
rc
));
else
{
else
{
_update_cred_key
();
_update_cred_key
();
set_slurmctld_state_loc
();
set_slurmctld_state_loc
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment