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
c2811de7
Commit
c2811de7
authored
8 years ago
by
Brian Christiansen
Browse files
Options
Downloads
Patches
Plain Diff
Prevent zombie threads in persistant connections
parent
ab639d8f
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_persist_conn.c
+16
-0
16 additions, 0 deletions
src/common/slurm_persist_conn.c
with
16 additions
and
0 deletions
src/common/slurm_persist_conn.c
+
16
−
0
View file @
c2811de7
...
@@ -314,6 +314,22 @@ static void *_service_connection(void *arg)
...
@@ -314,6 +314,22 @@ static void *_service_connection(void *arg)
slurm_persist_conn_free_thread_loc
(
service_conn
->
thread_loc
);
slurm_persist_conn_free_thread_loc
(
service_conn
->
thread_loc
);
// xfree(service_conn);
// xfree(service_conn);
/* In order to avoid zombie threads, detach the thread now before
* exiting. slurm_persist_conn_recv_server_fini() will not try to join
* the thread because slurm_persist_conn_free_thread_loc() will have
* free'd the connection. If their are threads at shutdown, the join
* will happen before the detach so recv_fini() will wait until the
* thread is done.
*
* pthread_join man page:
* Failure to join with a thread that is joinable (i.e., one that is not
* detached), produces a "zombie thread". Avoid doing this, since each
* zombie thread consumes some system resources, and when enough zombie
* threads have accumulated, it will no longer be possible to create new
* threads (or processes).
*/
pthread_detach
(
pthread_self
());
return
NULL
;
return
NULL
;
}
}
...
...
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