Closed Bug 1761563 Opened 3 years ago Closed 1 month ago

`./mach lint -l rst` does not respond at all on a 64-thread machine

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P2)

Tracking

(firefox132 fixed)

RESOLVED FIXED
132 Branch
Tracking Status
firefox132 --- fixed

People

(Reporter: saschanaz, Unassigned)

References

(Blocks 1 open bug)

Details

./mach lint -l rst --fix docs/code-quality/lint/linters/eslint-plugin-mozilla/use-isInstance.rst

This does not show any visual output at all, and does not respond to Control+C, so I need to kill python to stop it. Killing the most memory-consuming Python process among multiple dozens of them logs the following error:

> Traceback (most recent call last):
  File "c:\users\sasch\documents\github\gecko-dev\python\mozlint\mozlint\roller.py", line 71, in _run_worker
    res = func(paths, config, **lintargs)
  File "c:\users\sasch\documents\github\gecko-dev\python\mozlint\mozlint\types.py", line 57, in __call__
    return self._lint(paths, config, **lintargs)
  File "c:\users\sasch\documents\github\gecko-dev\python\mozlint\mozlint\types.py", line 148, in _lint
    return func(files, config, **lintargs)
  File "C:\Users\sasch\Documents\GitHub\gecko-dev\tools\lint\rst\__init__.py", line 100, in lint
    filename, lineno, level, message = parse_with_split(errors)
  File "C:\Users\sasch\Documents\GitHub\gecko-dev\tools\lint\rst\__init__.py", line 72, in parse_with_split
    filename, lineno, level, message = match.groups()
AttributeError: 'NoneType' object has no attribute 'groups'

This happens on both Python 3.9 and 3.10.

This happens on my build machine with 64 logical core but not on my laptop. 🤔

Summary: `./mach lint -l rst` does not respond at all → `./mach lint -l rst` does not respond at all (on machine with many cores?)

Ha, C:\Users\sasch\Documents\GitHub\gecko-dev\obj-x86_64-pc-mingw32\_virtualenvs\common\Scripts\python.EXE C:\Users\sasch\Documents\GitHub\gecko-dev\obj-x86_64-pc-mingw32\_virtualenvs\ common\Scripts\rstcheck.EXE --ignore-language=cpp,json C:/Users/sasch/Documents/GitHub/gecko-dev/docs/code-quality/lint/linters/eslint-plugin-mozilla/use-isInstance.rst throws this error:

Exception in thread Thread-1 (_handle_workers):
Traceback (most recent call last):
  File "C:\Users\sasch\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "C:\Users\sasch\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\sasch\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 519, in _handle_workers
    cls._wait_for_updates(current_sentinels, change_notifier)
  File "C:\Users\sasch\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 499, in _wait_for_updates
    wait(sentinels, timeout=timeout)
  File "C:\Users\sasch\AppData\Local\Programs\Python\Python310\lib\multiprocessing\connection.py", line 884, in wait
    ready_handles = _exhaustive_wait(waithandle_to_obj.keys(), timeout)
  File "C:\Users\sasch\AppData\Local\Programs\Python\Python310\lib\multiprocessing\connection.py", line 816, in _exhaustive_wait
    res = _winapi.WaitForMultipleObjects(L, False, timeout)
ValueError: need at most 63 handles, got a sequence of length 66

... which means this is https://github.com/myint/rstcheck/pull/86 again.

Can we somehow patch this library not to hit this?

Type: task → defect
Summary: `./mach lint -l rst` does not respond at all (on machine with many cores?) → `./mach lint -l rst` does not respond at all on a 64-thread machine

The severity field is not set for this bug.
:ahal, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(ahal)

As a workaround, maybe we could limit the num_procs to max 63 here? (or whatever number keeps us under the limit)
https://searchfox.org/mozilla-central/rev/d34f9713ae128a3138c2b70d8041a535f1049d19/python/mozlint/mozlint/roller.py#364

Severity: -- → S3
Flags: needinfo?(ahal)
Priority: -- → P2

It should be 61 as Python keeps 3. See also https://bugs.python.org/issue26903.

I can submit a patch if a local patch is okay.

Product: Firefox Build System → Developer Infrastructure

Given https://github.com/myint/rstcheck/pull/86 is now fixed and long released, could we upgrade rstcheck to include that?

Unfortunately I can't work out how to get the upgrade to work properly - it looks like there's conflicting packages for some reason.

Bug 1917163 has now upgraded rstcheck, could you confirm if this is now fixed please?

Depends on: 1917163
Flags: needinfo?(krosylight)

Thanks, this works now.

Status: NEW → RESOLVED
Closed: 1 month ago
Flags: needinfo?(krosylight)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.