• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gevent / gevent / 2792 / 4
85%
master: 78%

Build:
Build:
LAST BUILD BRANCH: fix-popen-exit-reentrant-close
DEFAULT BRANCH: master
Ran 15 Apr 2018 07:21PM UTC
Files 74
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Apr 2018 06:47PM UTC coverage: 68.709%. First build
TASK=test-py36

push

travis-ci

jamadden
Use /dev/fd|/proc/self/fd to get open FDs to close in Popen

If those aren't available, use the old brute-force approach. This is
closer to what CPython does in its C implementation, and is much
faster.

We don't have to worry about the async signal safe stuff the C code
does because, guess what, we're running Python code here already
anyway, so much of it could wind up doing something that's not
actually safe anyway. Oh well.

Since we depend on Python 3.4 and above now, we can rely on the
CLOEXEC flag being set by default and not have to manually check
everything.

This speeds up 2.7 (close_fds defaults to *false* there, so the
default case doesn't change):

| Benchmark                 | 27_bench_subprocess | 27_bench_subprocess_dirfd     |
+---------------------------+---------------------+-------------------------------+
| spawn native no close_fds | 1.81 ms             | 1.79 ms: 1.01x faster (-1%)   |
| spawn gevent no close_fds | 2.11 ms             | 2.20 ms: 1.04x slower (+4%)   |
| spawn native close_fds    | 31.0 ms             | 30.2 ms: 1.03x faster (-3%)   |
| spawn gevent close_fds    | 31.6 ms             | 2.56 ms: 12.31x faster (-92%) |

And it really speeds up 3.7 (close_fds defaults to *true* there, so
the default case is much faster, and the non-default case is even better):

| Benchmark                 | 37_bench_subprocess | 37_bench_subprocess_dirfd     |
+---------------------------+---------------------+-------------------------------+
| spawn native no close_fds | 1.34 ms             | 1.27 ms: 1.06x faster (-6%)   |
| spawn gevent no close_fds | 117 ms              | 3.05 ms: 38.27x faster (-97%) |
| spawn native close_fds    | 1.36 ms             | 1.30 ms: 1.04x faster (-4%)   |
| spawn gevent close_fds    | 32.5 ms             | 3.34 ms: 9.75x faster (-90%)  |

Fixes #1172

7997 of 11639 relevant lines covered (68.71%)

0.69 hits per line

Source Files on job 2792.4 (TASK=test-py36)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2537
  • Travis Job 2792.4
  • 461d6966 on github
  • Next Job for TASK=test-py36 on issue1172 (#2794.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc