git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@gmail.com>
To: Karl Wiberg <kha@virtutech.com>
Cc: mandolaerik@gmail.com, git@vger.kernel.org
Subject: Re: [PATCH] Work around performance bug in subprocess.Popen.communicate()
Date: Fri, 31 Jul 2009 12:27:53 +0100	[thread overview]
Message-ID: <b0943d9e0907310427r7e59aa5fi5e5ff5e3f3c03819@mail.gmail.com> (raw)
In-Reply-To: <20090731093632.7018.24435.stgit@october.e.vtech>

2009/7/31 Karl Wiberg <kha@virtutech.com>:
> @@ -110,7 +110,9 @@ class Run:
>                                  stdin = subprocess.PIPE,
>                                  stdout = subprocess.PIPE,
>                                  stderr = subprocess.PIPE)
> -            outdata, errdata = p.communicate(self.__indata)
> +            if self.__indata:
> +                p.stdin.write(self.__indata)
> +            outdata, errdata = p.communicate()
>             self.exitcode = p.returncode
>         except OSError, e:
>             raise self.exc('%s failed: %s' % (self.__cmd[0], e))

But can this not lead to a deadlock if the __indata is big? The stdout
of the created process is only processed once the whole __indata is
written. I thought communicate() was created to avoid this issue.

-- 
Catalin

  reply	other threads:[~2009-07-31 11:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-31  9:36 [PATCH] Work around performance bug in subprocess.Popen.communicate() Karl Wiberg
2009-07-31 11:27 ` Catalin Marinas [this message]
2009-08-04  8:51   ` Karl Wiberg
2009-08-13 22:18     ` Catalin Marinas
2009-08-14  6:21       ` Karl Wiberg
2009-08-14  7:26         ` Erik Sandberg
2009-08-14  8:12           ` Karl Wiberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0943d9e0907310427r7e59aa5fi5e5ff5e3f3c03819@mail.gmail.com \
    --to=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kha@virtutech.com \
    --cc=mandolaerik@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).