Connection getting killed off

AI-generated summary

BastianGrahm is experiencing a connection timeout issue with his Discourse plugin, Disraptor, which embeds an external website into the Discourse context. The external website is slow to serve certain routes, causing a “not_found” template to be rendered after 30 seconds. Despite increasing the unicorn worker timeout, the issue persists. leo.proctor suggests that the 30-second unicorn timeout is set in the unicorn.conf.rb file, and proposes making it configurable via an environment variable (ENV[“UNICORN_TIMEOUT”]) in production.

Hello,
I am working on a plugin for Discourse, called Disraptor, which works as a kind of reverse proxy to allow embedding another website into the Discourse context.

The website which should be embedded for us this way currently needs a long time to serve certain routes. Therefore a rendered “not_found” is received after 30 seconds.

Now I am aware, that the standard timeout for unicorn workers is 30 seconds in production environment. So I started with increasing this timeout by changing the unicorn config. Looking at the unicorn error log I can confirm that the unicorn worker gets killed later now but still the not_found template is getting rendered (before the worker gets killed off).

After more searching I was not able to find any clue where this 30 second timeout comes from or where it’s set. Even though the long serving time is an issue for itself and will probably get fixed in the future, right now it would be perfect if there was a possibiltity to change that timeout.
Does anyone have an idea how that might work?

Thank you in advance!

I believe the unicorn timeout of 30 seconds comes from here: https://github.com/discourse/discourse/blob/main/config/unicorn.conf.rb#L39

It would be nice if there is a way to change it e.g by ENV[“UNICORN_TIMEOUT”] in production.