Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion gevent + celery + subprocess + graylog = hang
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mark Hingston  
View profile  
 More options Nov 1 2012, 5:29 am
From: Mark Hingston <mrkhings...@gmail.com>
Date: Thu, 1 Nov 2012 02:29:05 -0700 (PDT)
Local: Thurs, Nov 1 2012 5:29 am
Subject: Re: [gevent] gevent + celery + subprocess + graylog = hang

On Wednesday, October 31, 2012 1:01:53 AM UTC+11, Denis Bilenko wrote:

> On Mon, Oct 29, 2012 at 8:01 AM, Mark Hingston <mrkhi...@gmail.com<javascript:>>
> wrote:

> > p = subprocess.Popen(['ffmpeg', ...], cwd='/my/dir/',
> stdin=subprocess.PIPE,
> > stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> > p.wait()

> Could it be that something else in your code messes with SIGCHLD or
> waitpid()? That could causes a hang here.

Sorry - my original description was poor. The lockup actually occurs at the
point when I call Popen. The call to Popen just never returns. It seems to
stay waiting on the socket read operation on the errpipe_read.read() call:

errpipe_read = FileObject(errpipe_read, 'rb')
data = errpipe_read.read()

It seems as though it's never receiving a read event even though the exec
completes correctly and the process that I'm calling runs and then even
terminates.

Also FWIW I don't think that anything is messing with SIGCHLD or waitpid,
not from what I could tell.

I had a bit of luck with applying the fix for issue 154: "Hang when calling
`fork()` after `socket.connect()`" - I added the relevant code to kill()
then join() on the thread pool around where subprocess does a fork and as
far as I could tell this prevented the code from locking up, however I
don't think that killing the threads is really a good solution for me here.
Surprisingly celery still seems to work and be able to process many
subsequent tasks that call subprocess. I've not really looked into how but
I've assumed it must be recreating threads for the pool as it needs them or
something like that.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.