Repository navigation
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 2 minor |
| ErrorProne | 1 high |
| Security | 1 medium 1 minor 3 high |
🟢 Metrics 20 complexity · 0 duplication
Metric Results Complexity 20 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
pre-commit.ci run |
|
pre-commit.ci run |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #668 +/- ##
=======================================
Coverage 79.10% 79.10%
=======================================
Files 23 23
Lines 2178 2178
=======================================
Hits 1723 1723
Misses 455 455 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jeertmans
left a comment
There was a problem hiding this comment.
Hi @rusetiq, thanks for your contribution, this looks like a very nice fix to an old problem!
Don't mind the pre-commit.ci app, it cannot run ty since it requires internet access :-/
Just run it locally and make sure that it passes the checks.
I'll review you PR soon, I just need some time to find a way to reproduce the bug.
| def reversed_iterdir(path: Path) -> Iterator[Path]: | ||
| return iter(reversed(list(original_iterdir(path)))) | ||
|
|
||
| monkeypatch.setattr(Path, "iterdir", reversed_iterdir) |
There was a problem hiding this comment.
Please use the context manager and only call the function that should be affected inside the scope :-)
| subprocess.call(("open", str(file))) | ||
| elif system == "Windows": | ||
| os.startfile(str(file)) # type: ignore[attr-defined] | ||
| os.startfile(str(file)) # nosec B606 # ty: ignore[unresolved-attribute] |
There was a problem hiding this comment.
What tool did you use to report a security issue? Because this error should not be raised by the linters used for this project.
There was a problem hiding this comment.
i used codacy’s public pr api for that as an external pr check before pushing, ill revert the unrelated stuff
|
Thanks! I removed the Codacy-specific accommodations in 2030a56 and verified the project checks locally. The full pre-commit suite passes (including ty), and the focused utility tests pass 3/3. I'll disregard the hosted pre-commit.ci dependency-download failures as suggested. |
|
Unfortunately, I cannot find a simple way to reproduce the deadlock issue. I know it depends on factors we cannot control, but do you have an example slides script that would also always stall? |
|
Hi @jeertmans, sorry for the long delay getting back to you, and thank you for taking the time to investigate this! I still owe you a reliable reproducer for the deadlock. The regression test in this PR covers the segment ordering fix, so it doesn't demonstrate the stall itself. I understand why a reproducible slides example is needed to validate the multiprocessing change. Thanks again for your patience, and apologies for leaving your question unanswered for so long. |
|
Hi @jeertmans, I've now added a reproducible case and pushed the update. The three-second slide is in uv run manim render tests/data/reversal_deadlock.py ReversalDeadlock -ql --disable_cachingOn a platform with Both the utility case and this slide stalled on unmodified The automated regression covers one and two workers, checks every output frame, and has a 30-second timeout with worker cleanup. Run it with: uv run pytest tests/test_utils.py -k inherited_renderer_lockI also scoped the frame-order monkeypatch to the reversal call as requested and resolved the conflicts with current Thanks again for your patience! |
for more information, see https://pre-commit.ci
|
hi @rusetiq, thanks for your reproducer! I'll review this when I can, hopefully by the end of next week |
Problem and fix
Addresses #562 and #569.
Segmented reversal can stall when a default
forkpool inherits a lock held by a renderer or logging thread. Reversal workers now use thespawncontext without changing the application's multiprocessing default. Generated segment paths are sorted before reversal and concatenation, and the extra dot in segment filenames is removed.Reproduction and coverage
tests/data/reversal_deadlock.pyprovides a small three-secondReversalDeadlockslide. It forces the application's default toforkand synchronizes a background thread holding the renderer's real Rich console lock at fork time. PyAV logging in inherited workers then blocks on that lock.__main__guard requirement are documented in the contributor internals guide.Validation
main(df0f1f1): both the utility case and slide example stalled and were terminated after 10 seconds.Merged current
mainand resolved the changelog, converter, and utility-test conflicts while preserving upstream fixes. The Windows opener uses a ty-specific suppression, and the required TOML formatter's whitespace changes are included.