Skip to content

Possible race condition in exec_helpers.Subprocess #58

@rayburgemeestre

Description

@rayburgemeestre

Hey,

I found a possible issue, that happened to me in a very slow VM. So it could be that the race condition doesn't happen often if the system is fast:

import exec_helpers

def test():
    with exec_helpers.Subprocess() as executor:
        apiserver = executor.check_call('sleep 1; echo bla bla')
        if apiserver:
            return apiserver.stdout_str
    raise AbortException("Could not start subprocess")

while True:
    print "1: {}\n".format(test())

This will produce output like this:

1: bla bla

1:

1: 

1: bla bla

So it can happen that sometimes the echo is not captured correctly. Running with strace it's visible that the echo did indeed execute, however it's not available in stdout_str.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions