innogames/igcommit

IMPROVEMENT: checking ulimit before processing a commit

si1en2i0 opened this issue · 9 comments

OSError occurred while pushing a commit of huge number(more than 2200) of files to remote.

remote: === CheckCommand "phpcs" on code/Doctrine/Common/Cache/WinCacheCache.php at 9f6ba964 ===
remote: INFO:
remote: INFO: FILE: code/Doctrine/Common/Cache/WinCacheCache.php
remote: INFO: ----------------------------------------------------------------------
remote: INFO: FOUND 13 ERRORS AND 7 WARNINGS AFFECTING 18 LINES
remote: INFO: ----------------------------------------------------------------------
remote: INFO: 2 | ERROR | You must use "/**" style comments for a file comment
remote: INFO: 25 | WARNING | @link tag is not allowed in class comment
remote: INFO: 26 | WARNING | @SInCE tag is not allowed in class comment
remote: INFO: 27 | WARNING | @author tag is not allowed in class comment
remote: INFO: 28 | WARNING | @author tag is not allowed in class comment
remote: INFO: 29 | WARNING | @author tag is not allowed in class comment
remote: INFO: 30 | WARNING | @author tag is not allowed in class comment
remote: INFO: 31 | WARNING | @author tag is not allowed in class comment
remote: INFO: 35 | ERROR | Doc comment for parameter "$id" missing
remote: INFO: 37 | ERROR | Missing @return tag in function comment
remote: INFO: 43 | ERROR | Doc comment for parameter "$id" missing
remote: INFO: 45 | ERROR | Missing @return tag in function comment
remote: INFO: 51 | ERROR | Doc comment for parameter "$id" missing
remote: INFO: 51 | ERROR | Doc comment for parameter "$data" missing
remote: INFO: 51 | ERROR | Doc comment for parameter "$lifeTime" missing
remote: INFO: 53 | ERROR | Missing @return tag in function comment
remote: INFO: 59 | ERROR | Doc comment for parameter "$id" missinTraceback (most recent call last):
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 97, in main
remote: state = Runner().run()
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 28, in run
remote: for check in iter_buffer(self.expand_checks(checks), 16):
remote: File "/root/githook/igcommit/igcommit/utils.py", line 50, in iter_buffer
remote: for elem in iterable:
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 41, in expand_checks
remote: for check in self.expand_checks_to_input(next_checks, line):
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 57, in expand_checks_to_input
remote: for check in self.expand_checks_to_commit_list(checks, commit_list):
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 67, in expand_checks_to_commit_list
remote: for check in self.expand_checks_to_commit(next_checks, commit):
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 78, in expand_checks_to_commit
remote: for check in self.expand_checks_to_file(next_checks, changed_file):
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 90, in expand_checks_to_file
remote: for check in prepare_checks(checks, changed_file):
remote: File "/root/githook/igcommit/igcommit/base_check.py", line 94, in prepare_checks
remote: prepared_check = check.prepare(obj)
remote: File "/root/githook/igcommit/igcommit/file_checks.py", line 191, in prepare
remote: new._prepare_proc()
remote: File "/root/githook/igcommit/igcommit/file_checks.py", line 226, in _prepare_proc
remote: [self.get_exe_path()] + self._prepared_args()
remote: File "/root/githook/igcommit/igcommit/git.py", line 314, in pass_content
remote: target_proc = Popen(proc_args, stdin=stdin, stdout=PIPE, stderr=STDOUT)
remote: File "/usr/lib64/python2.7/subprocess.py", line 711, in init
remote: errread, errwrite)
remote: File "/usr/lib64/python2.7/subprocess.py", line 1216, in _execute_child
remote: errpipe_read, errpipe_write = self.pipe_cloexec()
remote: File "/usr/lib64/python2.7/subprocess.py", line 1168, in pipe_cloexec
remote: r, w = os.pipe()
remote: OSError: [Errno 24] Too many open files
remote: g
remote: INFO: 61 | ERROR | Missing @return tag in function comment
remote: INFO: 69 | ERROR | Missing @return tag in function comment
remote: INFO: 77 | ERROR | Missing @return tag in function comment
remote: INFO: ----------------------------------------------------------------------
remote: INFO:
remote: INFO: Time: 32ms; Memory: 4Mb
remote: INFO:

I must be leaking file descriptors somewhere. I will fix it. Thank you for the report.

I have pushed a fix for this. Could you please confirm than it fixes your problem? You can use the command on the README to re-run the check. I will then release a new version.

Hi,

The bug still exists on commit 8883eb.

remote: === CheckCommand "phpcs" on code/Doctrine/Common/Cache/SQLite3Cache.php at 90b85c85 ===
remote: ERROR: line 2: col 1: You must use "/**" style comments for a file comment
remote: WARNING: line 28: col 4: @SInCE tag is not allowed in class comment
remote: WARNING: line 29: col 4: @author tag is not allowed in class comment
remote: ERROR: line 52: col 13: Private member variable "sqlite" must contain a leading underscore
remote: ERROR: line 57: col 13: Private member variable "table" must contain a leading underscore
remote: ERROR: line 65: col 8: Missing parameter comment
remote: ERROR: line 66: col 8: Missing parameter comment
remote: ERROR: line 66: col 8: Expected 2 spaces after parameter type; 1 found
remote: ERROR: line 75: col 31: Opening parenthesis of a multi-line function call must be the last content on the line
remote: ERROR: line 81: col 10: Closing parenthesis of a multi-line function call must be on a line by itself
remote: ERROR: line 84: col 5: Doc comment for parameter "$id" missing
remote: ERROR: line 86: col 6: Missing @return tag in function comment
remote: ERROR: line 93: col 16: TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
remote: ERROR: line 96: col 5: Doc comment for parameter "$id" missing
remote: ERROR: line 98: col 6: Missing @return tag in function comment
remote: ERROR: line 101: col 47: TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
remote: ERROR: line 104: col 5: Doc comment for parameter "$id" missing
remote: ERROR: line 104: col 5: Doc comment for parameter "$data" missing
remote: ERROR: line 104: col 5: Doc comment for parameter "$lifeTime" missing
remote: ERROR: line 106: col 6: Missing @return tag in function comment
remote: ERROR: line 109: col 37: Opening parenthesis of a multi-line function call must be the last content on the line
remote: ERROR: line 113: col 10: Closing parenthesis of a multi-line function call must be on a line by itself
remote: ERROR: line 117: Traceback (most recent call last):
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 97, in main
remote: state = Runner().run()
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 29, in run
remote: for check in iter_buffer(self.expand_checks(checks), 16):
remote: File "/root/githook/igcommit/igcommit/utils.py", line 19, in iter_buffer
remote: for elem in iterable:
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 42, in expand_checks
remote: for check in self.expand_checks_to_input(next_checks, line):
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 58, in expand_checks_to_input
remote: for check in self.expand_checks_to_commit_list(checks, commit_list):
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 68, in expand_checks_to_commit_list
remote: for check in self.expand_checks_to_commit(next_checks, commit):
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 78, in expand_checks_to_commit
remote: for check in self.expand_checks_to_file(next_checks, changed_file):
remote: File "/root/githook/igcommit/igcommit/prereceive.py", line 90, in expand_checks_to_file
remote: for check in prepare_checks(checks, changed_file):
remote: File "/root/githook/igcommit/igcommit/base_check.py", line 94, in prepare_checks
remote: prepared_check = check.prepare(obj)
remote: File "/root/githook/igcommit/igcommit/file_checks.py", line 206, in prepare
remote: new._prepare_proc()
remote: File "/root/githook/igcommit/igcommit/file_checks.py", line 244, in _prepare_proc
remote: stderr=STDOUT,
remote: File "/usr/lib64/python2.7/subprocess.py", line 711, in init
remote: errread, errwrite)
remote: File "/usr/lib64/python2.7/subprocess.py", line 1216, in _execute_child
remote: errpipe_read, errpipe_write = self.pipe_cloexec()
remote: File "/usr/lib64/python2.7/subprocess.py", line 1168, in pipe_cloexec
remote: r, w = os.pipe()
remote: OSError: [Errno 24] Too many open files
remote: col 79: TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
remote: ERROR: line 122: col 5: Doc comment for parameter "$id" missing
remote: ERROR: line 124: col 6: Missing @return tag in function comment
remote: ERROR: line 129: col 37: Opening parenthesis of a multi-line function call must be the last content on the line
remote: ERROR: line 133: col 10: Closing parenthesis of a multi-line function call must be on a line by itself
remote: ERROR: line 142: col 6: Missing @return tag in function comment
remote: ERROR: line 150: col 6: Missing @return tag in function comment
remote: ERROR: line 153: col 9: Inline comments must start with a capital letter
remote: ERROR: line 159: col 8: Missing parameter comment
remote: ERROR: line 159: col 8: Expected 3 spaces after parameter type; 1 found
remote: ERROR: line 160: col 8: Missing parameter comment
remote: ERROR: line 164: col 51: TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
remote: ERROR: line 173: col 37: Opening parenthesis of a multi-line function call must be the last content on the line
remote: ERROR: line 178: col 10: Closing parenthesis of a multi-line function call must be on a line by itself
remote: ERROR: line 184: col 23: TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
remote: ERROR: line 185: col 20: TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
remote: ERROR: line 191: col 20: TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
remote: ERROR: line 210: col 8: Missing parameter comment
remote: ERROR: line 216: col 47: TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"

There is another suspicious place. I will fix it this time.

Could you please test it again?

Sorry.

Traceback (most recent call last):
File "/root/githook/igcommit/igcommit/prereceive.py", line 97, in main
state = Runner().run()
File "/root/githook/igcommit/igcommit/prereceive.py", line 29, in run
for check in iter_buffer(self.expand_checks(checks), 16):
File "/root/githook/igcommit/igcommit/utils.py", line 19, in iter_buffer
for elem in iterable:
File "/root/githook/igcommit/igcommit/prereceive.py", line 42, in expand_checks
for check in self.expand_checks_to_input(next_checks, line):
File "/root/githook/igcommit/igcommit/prereceive.py", line 58, in expand_checks_to_input
for check in self.expand_checks_to_commit_list(checks, commit_list):
File "/root/githook/igcommit/igcommit/prereceive.py", line 68, in expand_checks_to_commit_list
for check in self.expand_checks_to_commit(next_checks, commit):
File "/root/githook/igcommit/igcommit/prereceive.py", line 78, in expand_checks_to_commit
for check in self.expand_checks_to_file(next_checks, changed_file):
File "/root/githook/igcommit/igcommit/prereceive.py", line 90, in expand_checks_to_file
for check in prepare_checks(checks, changed_file):
File "/root/githook/igcommit/igcommit/base_check.py", line 94, in prepare_checks
prepared_check = check.prepare(obj)
File "/root/githook/igcommit/igcommit/file_checks.py", line 206, in prepare
new._prepare_proc()
File "/root/githook/igcommit/igcommit/file_checks.py", line 244, in _prepare_proc
stderr=STDOUT,
File "/usr/lib64/python2.7/subprocess.py", line 711, in init
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1216, in _execute_child
errpipe_read, errpipe_write = self.pipe_cloexec()
File "/usr/lib64/python2.7/subprocess.py", line 1168, in pipe_cloexec
r, w = os.pipe()
OSError: [Errno 24] Too many open files

I haven't paid attention that the second error you send was from a different place. I attempted to fix it now. Could you please check again?

The bug is gone. :D

Finally! Thank you for bearing with me. I found another bug related to symlinks. I will release a new version after fixing it too.