Skip to content

add timeout to prevent freescout from freezing when endpoint is not reachable - #20

Open
w-paheg wants to merge 1 commit into
fulldecent:mainfrom
w-paheg:main
Open

add timeout to prevent freescout from freezing when endpoint is not reachable#20
w-paheg wants to merge 1 commit into
fulldecent:mainfrom
w-paheg:main

Conversation

@w-paheg

@w-paheg w-paheg commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Hi, thanks again for this nice extension.

While running in production we ran into a problem that the whole fs freezes, because the webhook endpoint was not reachable. It locks up php workers until there are none left.

I added a timeout to the post request to fail quicker than max_execution_time.

BR Paul

@fulldecent

Copy link
Copy Markdown
Owner

Thank you for your note and implementation update! I see that you have updated the front and AJAX to add a timeout.

While I am reviewing your contribution, I need to understand how exactly this lockup is happening to know if this is the right approach. Because we are tunneling the request through the server there are two paths opened.

Could you please explain how the lockup is happening? Are you saying that the browser become unresponsive for this page load? Or are you saying that other access to the same instance from other browser tabs are also impacted?

@w-paheg

w-paheg commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Hi,

so I just tested it with a new FS instance with the sidebar installed.
I pointed the endpoint of the webhook to be imaginary 172.1.0.1:8080/freescout.v1.FreeScoutSideBar/Webhook
Then to simulate multiple people using FS, I just repeatedly clicked on the refresh button.
After several clicks the whole system is blocked, so I cant access it from another tab.

Then i tested with my changes, with the timeout in place the system will free up resources faster and is reachable faster, but a lock is still doable by clicking the refresh repeatedly.
So maybe additionally it would be good if clicking refresh would kill the other POST request or sth.

Hope this helps
BR Paul

@fulldecent

Copy link
Copy Markdown
Owner

Thank you for testing, that is different environment than I have been using and good to know.

Based on your results, it seems that the more appropriate solution is to set a timeout on the server side. That is because, for example, if the client loads the page and disconnect from the Internet, then the request will still be running on the server side and could lock up the limited available threads.

The timeouts you have done are appropriate, and they can apply on the server side. We probably do not need to do this now, but if somebody asks, then we could also make this timeout configurable in the settings.

@timstrasser-w

Copy link
Copy Markdown

+1 on this change. We had the same problem. When the webhook endpoint is unreachable, PHP workers pile up until FreeScout freezes. A timeout fixes it.

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