Skip to content

Feature skip plugins mid run - #1829

Open
Abu-Huraira21 wants to merge 22 commits into
abrignoni:mainfrom
Abu-Huraira21:feature_skip_plugins
Open

Feature skip plugins mid run#1829
Abu-Huraira21 wants to merge 22 commits into
abrignoni:mainfrom
Abu-Huraira21:feature_skip_plugins

Conversation

@Abu-Huraira21

Copy link
Copy Markdown

Adds --mp_per_plugin, an opt-in flag that runs each plugin in its own subprocess instead of the main process. Default
behavior (no flag) is unchanged.

Problem: a single hung/stuck plugin blocks the entire run with no way to recover short of killing the process.

Fix: with --mp_per_plugin, each plugin runs in a spawned subprocess. If one hangs:

  • Ctrl+C once → skips just that plugin, run continues
  • Ctrl+C twice within 2s → aborts the whole run
  • kill -USR1 / kill -USR2 (Unix) → skips current plugin externally, no abort risk

Files changed

  • ileapp.py — --mp_per_plugin flag, subprocess dispatch, skip signal handlers
  • scripts/mp_plugin_runner.py (new) — subprocess entrypoint
  • scripts/lavafuncs.py — idempotent LAVA init, open/close helpers for subprocess-safe DB access
  • scripts/ilapfuncs.py — picklable seeker/file-info snapshot for passing state into subprocesses

Known issue (not fixed by this PR)

Encrypted iTunes backups can fail to open the decrypted Manifest.db with unable to open database file — pre-existing,
unrelated to this change. Root cause: Manifest.db is WAL-mode, and open_sqlite_db_readonly() has no fallback for opening
WAL-mode DBs missing their -wal/-shm sidecar files. Reproducible on current main independent of --mp_per_plugin. Will
follow up with a separate PR (immutable=1 retry fix).

Testing

Verified --mp_per_plugin end-to-end against an iTunes backup extraction, including plugin skip via Ctrl+C and SIGUSR1.

Notes:

- Add dedicated _skip_handler for SIGUSR1/SIGUSR2 signals
- These signals always skip current plugin without abort risk
- Can be sent externally via: kill -USR1 <pid> or kill -USR2 <pid>
- Only registered on Unix-like systems (where available)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant