Skip to content

fix(cleanup): remove XPI temp files from /tmp on shutdown#1138

Closed
vringar wants to merge 1 commit intomasterfrom
fix/xpi-temp-cleanup
Closed

fix(cleanup): remove XPI temp files from /tmp on shutdown#1138
vringar wants to merge 1 commit intomasterfrom
fix/xpi-temp-cleanup

Conversation

@vringar
Copy link
Contributor

@vringar vringar commented Feb 23, 2026

Summary

  • Track temporary XPI files created by geckodriver during install_addon() and clean them up on browser shutdown/restart
  • Move tempdir cleanup outside the success block so it runs even on failed browser launches
  • Use extend() instead of = when collecting tmp_files to avoid leaking files from retried spawn attempts

Closes #1090

Changes

  • openwpm/deploy_browsers/deploy_firefox.py: Detect new XPI files via glob before/after install_addon(), report them via status queue
  • openwpm/browser_manager.py: Track tmp_files on BrowserManagerHandle, clean up in shutdown_browser() and restart_browser_manager()

Test plan

  • Verify XPI files are cleaned up after browser shutdown
  • Verify temp profile directories are cleaned up even on failed launches
  • Run full test suite to check for regressions

… shutdown

Track temporary XPI files created by geckodriver during install_addon()
and clean them up on browser shutdown/restart. Also moves tempdir cleanup
outside the success block so it runs even on failed browser launches.

Closes #1090
@vringar vringar force-pushed the fix/xpi-temp-cleanup branch from 8783515 to 0ee25b7 Compare February 23, 2026 14:57
@vringar
Copy link
Contributor Author

vringar commented Feb 23, 2026

Closing in favor of #1104 — the racy tracking approach doesn't align with OpenWPM's robustness-first philosophy.

@vringar vringar closed this Feb 23, 2026
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.

XPI files not deleted from /tmp

1 participant