Task #10155 (closed)
Bug: subprocess.wait() freezes "omero admin diagnostics"
| Reported by: | bpindelski | Owned by: | bpindelski |
|---|---|---|---|
| Priority: | major | Milestone: | OMERO-4.4.7 |
| Component: | Client | Version: | n.a. |
| Keywords: | n.a. | Cc: | sbesson, jamoore |
| Resources: | n.a. | Referenced By: | n.a. |
| References: | n.a. | Remaining Time: | n.a. |
| Sprint: | 2013-02-12 (5) |
Description (last modified by bpindelski)
https://github.com/openmicroscopy/openmicroscopy/pull/458 added a functionality on the 'develop' branch to display TCP ports of running applications when "omero admin diagnostics" got executed.
After adding my functionality related to PRs 586, 588 and ultimately 589, a bug has been discovered through extensive testing of admin.py on Windows.
The logic for displaying the ports relies on capturing the output of subprocess.popen. This in turn executes "icegridadmin" with specific parameters.
After the call to icegridadmin:
p2 = self.ctx.popen(self._cmd("-e", "application describe %s" % s)) # popen
the line
rv2 = p2.wait()
causes the Windows Command Prompt to freeze. From Python docs http://docs.python.org/2.6/library/subprocess.html:
[Popen.wait] will deadlock if the child process generates enough output to a stdout or stderr pipe such that it blocks waiting for the OS pipe buffer to accept more data. Use communicate() to avoid that.
Change History (8)
comment:1 Changed 7 years ago by bpindelski
- Description modified (diff)
- Status changed from new to accepted
comment:2 Changed 7 years ago by jmoore
comment:3 Changed 7 years ago by bpindelski
- Sprint changed from 2013-01-15 (4) to 2013-02-12 (5)
comment:4 Changed 7 years ago by bpindelski
Josh, the functionality from https://github.com/openmicroscopy/openmicroscopy/pull/458 is only on develop. Will it make it's way to dev_4_4? If so, I'd rather wait to have consistent code bases to work on. If no, then I'll go ahead and fix it on develop.
comment:5 Changed 7 years ago by jmoore
I'd vote +1 for rebasing.
comment:6 Changed 7 years ago by bpindelski
Closing. Fixed in https://github.com/openmicroscopy/openmicroscopy/pull/715.
comment:7 Changed 7 years ago by bpindelski
- Resolution set to fixed
- Status changed from accepted to closed
comment:8 Changed 6 years ago by Josh Moore <josh@…>
(In [bf9f60a7e2e2ea74da5883b1f8b8ddfb360e0739/ome.git] on branch develop) Merge pull request #725 from bpindelski/rebased/develop/diagnostics_10155
Fix hanging of diagnostics on Windows (see #10155) (rebased onto develop)
Blazej, thanks for picking this up. In at least one other case, Sebastien and I saw this happening. I wonder if there's a way to scan the Python code (PyLint??) for any cases of wait+PIPE to prevent this from happening again.