Skip to content

Commit

Permalink
swap setpgrp to setsid
Browse files Browse the repository at this point in the history
for some reason, setsid does NOT hang when using
containerized seqtk, while setpgrp does.
in the future, when dropping python2 support,
should probably switch to the start_new_session
option instead
  • Loading branch information
nsheff committed Aug 2, 2019
1 parent 457e03c commit 6232b6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Changelog

## [0.12.0] -- unreleased
## [0.12.0] -- 2019-08-02

### Added
- Use profile to determine total elapsed time
- `logging` functions directly on `PipelineManager`
- Re-export `add_logging_options` from `logmuse`, for direct use by a pipeline author.
- `logger_via_cli` that defaults to the `strict=False` behavior of the same-named function from `logmuse`
- Use logging for pypiper-generated output.

### Fixed
- Fix childless processes memory monitoring issue
- Fix problems with runtime reading from pipeline profile TSV formatted according to two styles

- Fix problems running containerized executables that would sometimes hang

## [0.11.3] -- 2019-06-17
### Fixed
Expand Down
6 changes: 4 additions & 2 deletions pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,10 +930,10 @@ def make_hash(o):
for i in range(len(param_list)):
running_processes.append(i)
if i == 0:
processes.append(psutil.Popen(preexec_fn=os.setpgrp, **param_list[i]))
processes.append(psutil.Popen(preexec_fn=os.setsid, **param_list[i]))
else:
param_list[i]["stdin"] = processes[i - 1].stdout
processes.append(psutil.Popen(preexec_fn=os.setpgrp, **param_list[i]))
processes.append(psutil.Popen(preexec_fn=os.setsid, **param_list[i]))
self.running_procs[processes[-1].pid] = {
"proc_name": get_proc_name(param_list[i]["args"]),
"start_time": start_time,
Expand Down Expand Up @@ -991,9 +991,11 @@ def proc_wrapup(i):
sleeptime = .0001

while running_processes:
self.debug("running")
for i in running_processes:
local_maxmems[i] = max(local_maxmems[i], (get_mem_child_sum(processes[i])))
self.peak_memory = max(self.peak_memory, local_maxmems[i])
self.debug(processes[i])
if not self._attend_process(processes[i], sleeptime):
proc_wrapup_text[i] = proc_wrapup(i)

Expand Down

0 comments on commit 6232b6f

Please sign in to comment.