Open Bug 1188863 Opened 4 years ago Updated 4 years ago

[mozprocess] mozprocess fail sometimes to kill a process under windows (OSError: Could not terminate process )

Categories

(Testing :: Mozbase, defect)

defect
Not set

Tracking

(Not tracked)

People

(Reporter: parkouss, Unassigned)

References

Details

Attachments

(1 file)

Attached file safeterminate.py
So, we can see this kind of issue in bug 1171418 for example.

After some digging, I found an interesting post about that (from a buildbot issue):

http://trac.buildbot.net/ticket/387?cversion=0&cnum_hist=4

which can redirect you to

http://parts.tigris.org/ds/viewMessage.do?dsForumId=8688&dsMessageId=2985014

and where you can find an implementation of a safe_terminate for windows which possibly fix the issue. (I attached it).

I think we should investigate this, at least it is probably not bad to fallback using this method when we fail with the current implementation.

:ahal, thoughts ?
Also, there is an other issue from that. If you call .wait(), and that a thread in parallel call kill and fail like described here, then wait() will return None; so the error in the thread is printed, but if nobody check the errcode to be something different than None then the execution continue - but the process is not terminated (and I assume a wait() call should either return when the process is terminated, or raise an exception).

See bug 1171418 comment 19, the print log show that (INFO : Browser exited with error code: None).
Attachment #8640471 - Attachment mime type: application/python → text/plain
See Also: → 1192485
You need to log in before you can comment on or make changes to this bug.