Skip to content

Shouldn't OSSUnixSubprocess>>#isRunning answer false after resuming the image? #87

@tinchodias

Description

@tinchodias

In the following script, a pharo process waits a os process. Then I save&quit and re-open the image, and the OS process answers it's running. I would expect a negative answer, or at least, to have another testing method that answers false. But didn't find one. Should we modify isRunning or add a new testing method?

osSubprocess :=
	OSSUnixSubprocess new
		command: 'tail';
		arguments: #('-f' '/var/log/system.log' );
		yourself.
pharoProcess := [ osSubprocess runAndWait ] fork.

"-- Accessing details in SAME session --"

osSubprocess. "OSSUnixSubprocess(Command: tail; Pid: 98737; Status: Not finished)"
pharoProcess isTerminated. "false"
osSubprocess isRunning. "true"
OSSVMProcess vmProcess childPids. "an OrderedCollection(98737)"


"-- Accessing details in ANOTHER session (after save&quit and reopen) --"

osSubprocess.  "OSSUnixSubprocess(Command: tail; Pid: 98737; Status: Not finished)"
pharoProcess isTerminated. "true"
osSubprocess isRunning. "true"
OSSVMProcess vmProcess childPids. "an OrderedCollection()"

The OSSVMProcess clean ups the collection of child processes on image resume:

startUp: resuming
	resuming ifTrue: [ self initializeVMProcessInstance ]

My opinion is that isRunning should test if its pid is included in OSSVMProcess's childPids

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions