Skip to content

fix: Widget idle reaper can kill an active long-lived widget request#895

Open
sam-saffron-jarvis wants to merge 1 commit into
SamSaffron:mainfrom
sam-saffron-jarvis:feat/codereview-35b84a6c
Open

fix: Widget idle reaper can kill an active long-lived widget request#895
sam-saffron-jarvis wants to merge 1 commit into
SamSaffron:mainfrom
sam-saffron-jarvis:feat/codereview-35b84a6c

Conversation

@sam-saffron-jarvis

Copy link
Copy Markdown
Contributor

What changed

  • Track active proxied widget requests with an inFlight counter on each widget entry.
  • Increment the counter before handing a request to the reverse proxy, decrement it when the proxy returns, and refresh lastReq on completion.
  • Make the idle reaper skip running widgets that still have in-flight proxied requests.
  • Add a regression test that holds a proxied widget request open past the idle timeout, verifies the reaper does not stop it, then verifies idle reaping still stops the widget after the request completes.

Why this is high-value

Widgets are a visible Jarvis/web UI surface, and long-lived requests such as streams, long polls, or WebSocket-style proxied connections can legitimately stay open longer than the 10 minute idle timeout. Previously the reaper only considered request start time, so it could terminate the widget process and clear its proxy while a user-visible request was still active.

Validation

  • go test ./internal/widgets
  • go build ./...
  • go test ./...
  • git diff --check

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