Skip to content
This repository was archived by the owner on Sep 20, 2018. It is now read-only.
This repository was archived by the owner on Sep 20, 2018. It is now read-only.

Forcing a connection close() #45

@alfredodeza

Description

@alfredodeza

We are having some issues when doing remote subprocess calls (actually using subprocess.check_call) where as soon as we hit the close() method on the connection object it blocks forever.

The (partial) reason for this is because the message streams are acquiring a lock and since there are no timeouts for closing it basically stops all threads from closing the connection and it deadlocks.

This is extremely severe for us as we can't do anything but to Ctrl-C the command to exit.

On the actual machines that call we see a bunch of these processes around after a while:

root     36535  0.1  0.0 325188  8360 pts/4    Sl   12:03   0:00 python -u -c exec reduce(lambda a,b: a+b, map(chr,...

All that the remote subprocess command is doing is starting a service, that service in turn backgrounds a script call (something like bash script.sh 2> /dev/null & )

That script will do a long running process which might not complete but the user does not care, it should just be a fire and forget and then close the connection.

When starting that service manually in the remote machine everything works as expected. There are no errors, tracebacks (or exceptions), it just deadlocks.

The actual part where the deadlock occurs is on this file:

pushy-0.5.3-py2.6.egg/pushy/protocol/baseconnection.py

In the MessageStream class, in the close() method when trying to do this:

self.__lock.acquire()

Is there anyway I could force closing the connection? I am no longer sure what else to try.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions