[DRE-commits] [ruby-pygments.rb] 09/09: Set reasonable upper limit to RLIMIT_NOFILE

Cédric Boutillier boutil at moszumanska.debian.org
Sun Nov 26 21:11:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch patch-queue/master
in repository ruby-pygments.rb.

commit d69d8e9ea11f9cd6652ef4cb066356792182af7e
Author: Cédric Boutillier <boutil at debian.org>
Date:   Fri Sep 29 22:49:47 2017 +0200

    Set reasonable upper limit to RLIMIT_NOFILE
    
    When RLIMIT_NOFILE is too high, the number of files to close
    can be too important and the process of closing could take more time
    than the timeout set (default to 8s).
    
    This causes asciidoctor to crash on some architectures
    
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=876768
    
    Gbp-Pq: Name 0008-Set-reasonable-upper-limit-to-RLIMIT_NOFILE.patch
---
 lib/pygments/mentos.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/pygments/mentos.py b/lib/pygments/mentos.py
index 9c7c650..cf70b7b 100755
--- a/lib/pygments/mentos.py
+++ b/lib/pygments/mentos.py
@@ -334,7 +334,7 @@ def main():
         # close fd's inherited from the ruby parent
         import resource
         maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
-        if maxfd == resource.RLIM_INFINITY:
+        if maxfd >= 65536:
             maxfd = 65536
 
         for fd in range(3, maxfd):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-pygments.rb.git



More information about the Pkg-ruby-extras-commits mailing list