Skip to content

Improve timeouts handling to make sure Node processes are not hanging#107

Open
katafrakt wants to merge 1 commit into
revelrylabs:masterfrom
katafrakt:improve-timeouts-handling
Open

Improve timeouts handling to make sure Node processes are not hanging#107
katafrakt wants to merge 1 commit into
revelrylabs:masterfrom
katafrakt:improve-timeouts-handling

Conversation

@katafrakt
Copy link
Copy Markdown

This is a followup to #102 with improvements suggested there in the closing comment.

This improves how timeouts are handles by:

  • Removing the race condition from where timeout originates - now it's always coming from GenServer.call
  • Killing the worker process on timeout, so the next time the worker is checked out from the pool, it for sure has a fresh and working timeout
  • Replacing returning strings in error tuples with an atom

This improves how timeouts are handles by:
- Removing the race condition from where timeout originates - now it's
  always coming from GenServer.call
- Killing the process on timeout, so the next time the worker is checked
  out from the pool, it for sure has a fresh and working timeout
- Replacing returning strings in error tuples with an atom
Copy link
Copy Markdown

@s3cur3 s3cur3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lovely simplification, and way better than my initial attempt to standardize the timeout handling in #102. 🙌

@jtippett
Copy link
Copy Markdown

jtippett commented May 9, 2026

+1 — we hit this exact case_clause crash in production after upgrading to 3.1.4. Our Node SSR worker SIGABRT'd (exit 134) and the worker GenServer crashed with CaseClauseError({:error, {:exit, 134}}) because get_response/4 started returning that shape in #105 but handle_call/3's case clause was never updated to match it.

The catch-all {:error, _} = error -> {:reply, error, state} here is the right fix. We've pinned to this branch via {:nodejs, github: "katafrakt/elixir-nodejs", ref: "..."} to keep production working — would love to see this merged so we can switch back to a hex release. Happy to test if that helps.

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.

3 participants