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
4b72d5b7
Commit
4b72d5b7
authored
18 years ago
by
Christopher J. Morrone
Browse files
Options
Downloads
Patches
Plain Diff
svn merge -r10563:10575
https://eris.llnl.gov/svn/slurm/branches/slurm-1.1
parent
e03b7438
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/common/slurm_protocol_socket_implementation.c
+44
-25
44 additions, 25 deletions
src/common/slurm_protocol_socket_implementation.c
with
44 additions
and
25 deletions
src/common/slurm_protocol_socket_implementation.c
+
44
−
25
View file @
4b72d5b7
...
...
@@ -575,37 +575,56 @@ extern int _slurm_connect (int __fd, struct sockaddr const * __addr,
* Timeouts in excess of 3 minutes have been observed, resulting
* in serious problems for slurmctld. Making the connect call
* non-blocking and polling seems to fix the problem. */
int
rc
=
-
1
,
flags
;
int
rc
,
flags
,
err
;
socklen_t
len
;
struct
pollfd
ufds
;
flags
=
fcntl
(
__fd
,
F_GETFL
);
fcntl
(
__fd
,
F_SETFL
,
flags
|
O_NONBLOCK
);
err
=
0
;
rc
=
connect
(
__fd
,
__addr
,
__len
);
if
((
rc
==
-
1
)
&&
(
errno
==
EINPROGRESS
))
{
int
poll_rc
;
struct
pollfd
ufds
;
ufds
.
fd
=
__fd
;
ufds
.
events
=
POLLIN
|
POLLOUT
;
ufds
.
revents
=
0
;
poll_rc
=
poll
(
&
ufds
,
1
,
5000
);
if
(
poll_rc
==
1
)
{
/* poll successfully completed */
if
(
ufds
.
revents
&
POLLERR
)
{
int
err
=
0
;
socklen_t
size
;
if
(
getsockopt
(
__fd
,
SOL_SOCKET
,
SO_ERROR
,
&
err
,
&
size
)
==
0
)
{
slurm_seterrno
(
err
);
}
debug2
(
"connect failure: %m"
);
}
else
rc
=
0
;
}
else
{
slurm_seterrno
(
ETIMEDOUT
);
debug2
(
"poll: %m"
);
}
if
(
rc
<
0
&&
errno
!=
EINPROGRESS
)
return
-
1
;
if
(
rc
==
0
)
goto
done
;
/* connect completed immediately */
ufds
.
fd
=
__fd
;
ufds
.
events
=
POLLIN
|
POLLOUT
;
ufds
.
revents
=
0
;
rc
=
poll
(
&
ufds
,
1
,
5000
);
if
(
rc
==
-
1
)
{
/* poll failed */
error
(
"_slurm_connect poll failed: %m"
);
return
-
1
;
}
else
if
(
rc
==
0
)
{
/* poll timed out before any socket events */
slurm_seterrno
(
ETIMEDOUT
);
debug2
(
"_slurm_connect poll timeout: %m"
);
return
-
1
;
}
else
{
/* poll saw an event on the socket */
/* We need to check if the connection succeeded by
using getsockopt. The revent is not necessarily
POLLERR when the connection fails! */
len
=
sizeof
(
err
);
if
(
getsockopt
(
__fd
,
SOL_SOCKET
,
SO_ERROR
,
&
err
,
&
len
)
<
0
)
return
-
1
;
/* solaris pending error */
}
done:
fcntl
(
__fd
,
F_SETFL
,
flags
);
return
rc
;
if
(
err
)
{
errno
=
err
;
debug2
(
"_slurm_connect failed: %m"
);
errno
=
err
;
return
-
1
;
}
return
0
;
#endif
}
...
...
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