Closed
Bug 1369711
Opened 7 years ago
Closed 6 years ago
[mozlint] Investigate and fix ability to Ctrl-C lint run
Categories
(Developer Infrastructure :: Lint and Formatting, defect, P1)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox61 fixed)
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: ahal, Assigned: ahal)
References
Details
Attachments
(2 files)
Mozlint used to exit gracefully on a KeyboardInterrupt, but now it seems that the process hangs. Not sure when this stopped working, need to investigate and fix this (and write a test).
Comment 1•7 years ago
|
||
I've seen this occasionally when running ESLint. Although I think it might be a matter of timing - doing it at the wrong time hangs, but sometimes I can ctrl-c just fine.
Assignee | ||
Comment 2•7 years ago
|
||
Hm yeah, it does seem to be exiting gracefully now.. though flake8 does take awhile (~5-10 seconds) to clean up after itself. When I filed this I was definitely seeing tracebacks on Ctrl-C though, which shouldn't be happening. I guess I'll leave this open for now, maybe we'll run into it again and find reliable STR.
Summary: [mozlint] Fix ability to Ctrl-C lint run → [mozlint] Investigate and fix ability to Ctrl-C lint run
Updated•7 years ago
|
Priority: -- → P5
Assignee | ||
Comment 3•6 years ago
|
||
This has regressed pretty badly with recent changes. Luckily I think I've managed to come up with a good fix.
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Priority: P5 → P1
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•6 years ago
|
||
I'm going to see if I can figure out an easy way to write a test for this tomorrow. Though I'm also going to be PTO for two weeks starting Monday, so might run out of time. Either way, with this patch using Ctrl-C seems to work flawlessly (granted I'm scared to try Windows).
Updated•6 years ago
|
Product: Testing → Firefox Build System
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•6 years ago
|
Attachment #8953237 -
Flags: review?(gps)
Attachment #8958610 -
Flags: review?(gps)
Assignee | ||
Comment 8•6 years ago
|
||
Hey gps, sorry I know you aren't familiar with this module at all, but for this series I thought it would be more important for the reviewer to be familiar with concurrent.futures. If you have suggestions for alternate reviewers feel free to change it. Hopefully the commit messages/comments provide enough context. The first commit is precursor work to the second one (which is what actually fixes the bug). Let me know if you have any questions.
Comment 9•6 years ago
|
||
mozreview-review |
Comment on attachment 8953237 [details] Bug 1369711 - [mozlint] Refactor concurrent.futures ProcessPoolExecutor code for readability https://reviewboard.mozilla.org/r/222526/#review233922 This is a pretty large refactor. I wish it were smaller to make review easier. I suspect there may be some lingering issues around process pool cleanup. These things are hard to get right. But anyway, the refactor looks pretty straightforward. There's pretty good test coverage here. So that makes me feel a lot better that things didn't slip under the radar. ::: python/mozlint/mozlint/roller.py:185 (Diff revision 2) > # we're done adding to it. > paths = map(os.path.abspath, paths) > > num_procs = num_procs or cpu_count() > - all_results = defaultdict(list) > - with ProcessPoolExecutor(num_procs) as executor: > + jobs = list(self._generate_jobs(paths, num_procs)) > + Removing the context manager here and not replacing with a ``try..finally`` makes me a little nervous. But I think things will be fine. There may be a tiny window where if a SIGINT or other interrupt comes in between creating the process pool and mucking with the signal handler.
Attachment #8953237 -
Flags: review?(gps) → review+
Comment 10•6 years ago
|
||
mozreview-review |
Comment on attachment 8958610 [details] Bug 1369711 - [mozlint] Make sure KeyboardInterrupts are handled well wherever they happen https://reviewboard.mozilla.org/r/227518/#review233924 The code changes look fine. There's likely a race condition in the test. I suppose not many people run these tests. Pretty much any test relying on `sleep()` will fail intermittently under some conditions. But if CI is happy, I'm happy.
Attachment #8958610 -
Flags: review?(gps) → review+
Comment 11•6 years ago
|
||
mozreview-review-reply |
Comment on attachment 8953237 [details] Bug 1369711 - [mozlint] Refactor concurrent.futures ProcessPoolExecutor code for readability https://reviewboard.mozilla.org/r/222526/#review233922 > Removing the context manager here and not replacing with a ``try..finally`` makes me a little nervous. But I think things will be fine. There may be a tiny window where if a SIGINT or other interrupt comes in between creating the process pool and mucking with the signal handler. This was made better in the next commit. Yay!
Assignee | ||
Comment 12•6 years ago
|
||
mozreview-review-reply |
Comment on attachment 8958610 [details] Bug 1369711 - [mozlint] Make sure KeyboardInterrupts are handled well wherever they happen https://reviewboard.mozilla.org/r/227518/#review233924 Yeah I don't like it either, but I couldn't think of any better way to test this :/ Unrelated to the sleep issue, I found out this test fails on Windows (sending signal.CTRL_C_EVENT doesn't seem to work as expected). I'll spend a bit of time trying to fix it, but may just end up disabling the test on Windows if it ends up being too difficult. On Linux the test seems reliable.
Comment hidden (mozreview-request) |
Comment 14•6 years ago
|
||
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9712703bd242 [mozlint] Refactor concurrent.futures ProcessPoolExecutor code for readability r=gps https://hg.mozilla.org/integration/autoland/rev/7fb1a832336d [mozlint] Make sure KeyboardInterrupts are handled well wherever they happen r=gps
Comment 15•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9712703bd242 https://hg.mozilla.org/mozilla-central/rev/7fb1a832336d
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•