Skip to content

Multithreaded servers in development

Robin Daugherty edited this page Nov 15, 2019 · 1 revision

If your application web server runs multiple threads, you will likely run into problems using Better Errors.

Better Errors stores the most recent exception and the information about it in the current thread. If each request is not being sent to the same thread, Better Errors will not be able to retrieve the exception information and will report "Session expired" instead.

Because of the nature of threaded web servers, each request may be handled by a different thread. So this error doesn't always appear immediately.

Sometimes, the issue will occur when you're using the Better Errors console and you type a statement or click a stack frame.

The solution is to configure your Rails server (the default now being Puma) to run single-threaded in development.