Fix browser shared executor cleanup deadlock#3310
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
Python API breakage checks — ✅ PASSEDResult: ✅ PASSED |
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
Coverage Report •
|
|||||||||||||||||||||||||
…-executor-deadlock # Conflicts: # openhands-tools/openhands/tools/browser_use/definition.py # openhands-tools/openhands/tools/browser_use/impl.py # tests/tools/browser_use/test_browser_toolset.py
all-hands-bot
left a comment
There was a problem hiding this comment.
🟡 Acceptable, but this PR currently has no effective diff: GitHub reports 0 changed files, and git diff 701a8dbc...6cebeee7 is empty. If the browser cleanup fix is already on main, this PR should likely be closed as a no-op; otherwise please rebase/reapply the intended changes so they are actually reviewable.
[RISK ASSESSMENT]
- [Overall PR]
⚠️ Risk Assessment: 🟢 LOW — merging the current head would not change code, but it also would not deliver the described fix.
VERDICT:
❌ Needs rework: the PR needs either a real diff or closure as already superseded.
Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/software-agent-sdk/actions/runs/26411135225
|
Closing this draft as a no-op: the PR now has 0 changed files against |
Why
Fixes #3309. Browser executor finalizers could contend on the shared executor singleton lock even when the executor being cleaned up was not the shared singleton. On Windows, that could deadlock if cleanup happened while
BrowserToolSet.create()held the non-reentrant shared lock during executor construction.Summary
_shared_executor_lockand only publish them under the lock._shared_executor_lockduringBrowserToolExecutor.close()unless the executor is currently the shared singleton.Issue Number
Fixes #3309
How to Test
Ran targeted browser toolset tests:
Ran pre-commit on changed files:
I did not reproduce the original 30-minute Windows CI timeout locally because it is timing-sensitive and platform-specific. The new regression tests exercise the lock-ordering conditions that made the deadlock possible before this fix.
Video/Screenshots
N/A — backend test/tooling change only.
Type
Notes
This PR was created by an AI agent (OpenHands) on behalf of the user.
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.13-nodejs22-slimgolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:6cebeee-pythonRun
All tags pushed for this build
About Multi-Architecture Support
6cebeee-python) is a multi-arch manifest supporting both amd64 and arm646cebeee-python-amd64) are also available if needed