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
0e137e3b
Commit
0e137e3b
authored
18 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
svn merge -r10349:10353
https://eris.llnl.gov/svn/slurm/branches/slurm-1.1
parent
a37caa3a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/sched/wiki2/event.c
+26
-11
26 additions, 11 deletions
src/plugins/sched/wiki2/event.c
with
26 additions
and
11 deletions
src/plugins/sched/wiki2/event.c
+
26
−
11
View file @
0e137e3b
...
@@ -88,6 +88,15 @@ static int _open_fd(time_t now)
...
@@ -88,6 +88,15 @@ static int _open_fd(time_t now)
return
0
;
return
0
;
}
}
static
void
_close_fd
(
void
)
{
if
(
event_fd
==
-
1
)
return
;
(
void
)
slurm_shutdown_msg_engine
(
event_fd
);
event_fd
=
-
1
;
}
/*
/*
* event_notify - Notify Moab of some event
* event_notify - Notify Moab of some event
* msg IN - event type, NULL to close connection
* msg IN - event type, NULL to close connection
...
@@ -105,7 +114,7 @@ extern int event_notify(char *msg)
...
@@ -105,7 +114,7 @@ extern int event_notify(char *msg)
if
(
job_aggregation_time
if
(
job_aggregation_time
&&
(
difftime
(
now
,
last_notify_time
)
<
job_aggregation_time
))
{
&&
(
difftime
(
now
,
last_notify_time
)
<
job_aggregation_time
))
{
info
(
"wiki event notification already sent recently"
);
debug
(
"wiki event notification already sent recently"
);
return
0
;
return
0
;
}
}
...
@@ -113,9 +122,9 @@ extern int event_notify(char *msg)
...
@@ -113,9 +122,9 @@ extern int event_notify(char *msg)
while
(
retry
)
{
while
(
retry
)
{
if
((
event_fd
==
-
1
)
&&
((
rc
=
_open_fd
(
now
))
==
-
1
))
{
if
((
event_fd
==
-
1
)
&&
((
rc
=
_open_fd
(
now
))
==
-
1
))
{
/* Can't even open socket.
/* Can't even open socket.
* Don't retry again for a while (
10
mins)
* Don't retry again for a while (
2
mins)
* to avoid long delays from ETIMEDOUT */
* to avoid long delays from ETIMEDOUT */
last_notify_time
=
now
+
60
0
;
last_notify_time
=
now
+
12
0
;
break
;
break
;
}
}
...
@@ -124,9 +133,15 @@ extern int event_notify(char *msg)
...
@@ -124,9 +133,15 @@ extern int event_notify(char *msg)
* just that some of it went through to wake up Moab)
* just that some of it went through to wake up Moab)
*/
*/
if
(
write
(
event_fd
,
"1234"
,
5
)
>
0
)
{
if
(
write
(
event_fd
,
"1234"
,
5
)
>
0
)
{
info
(
"wiki event_notification sent: %s"
,
msg
);
verbose
(
"wiki event_notification sent: %s"
,
msg
);
last_notify_time
=
now
;
last_notify_time
=
now
;
rc
=
0
;
rc
=
0
;
/* Dave Jackson says to leave the connection
* open, but Moab isn't. Without the _close_fd()
* here, the next write() generates a broken pipe
* error. Just remove the _close_fd() and this
* comment when Moab maintains the connection. */
_close_fd
();
break
;
/* success */
break
;
/* success */
}
}
...
@@ -136,14 +151,14 @@ extern int event_notify(char *msg)
...
@@ -136,14 +151,14 @@ extern int event_notify(char *msg)
if
((
errno
==
EAGAIN
)
||
(
errno
==
EINTR
))
if
((
errno
==
EAGAIN
)
||
(
errno
==
EINTR
))
continue
;
continue
;
/* close socket, re-open later */
_close_fd
();
(
void
)
slurm_shutdown_msg_engine
(
event_fd
);
if
(
errno
==
EPIPE
)
{
event_fd
=
-
1
;
/* If Moab closed the socket we get an EPIPE,
* retry once */
if
(
errno
!=
EPIPE
)
continue
;
}
else
{
break
;
break
;
/* If Moab closed the socket we get an EPIPE,
}
* retry once */
}
}
pthread_mutex_unlock
(
&
event_mutex
);
pthread_mutex_unlock
(
&
event_mutex
);
...
...
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