unosquare / embedio

A tiny, cross-platform, module based web server for .NET
http://unosquare.github.io/embedio
Other
1.44k stars 175 forks source link

server stop responding after some time #595

Open RagibNoor opened 2 months ago

RagibNoor commented 2 months ago

Describe the bug After upgrading from Xamarin to MAUI, I encountered an issue with EmbedIO. Within my application, I run two EmbedIO servers: one serves the frontend static files and the other handles backend APIs. However, after a certain number of calls from the frontend application, the backend server stops responding. This issue only seems to occur in device builds.

To Reproduce Steps to reproduce the behavior: 1 Upgrade from Xamarin to MAUI. 2 Set up two EmbedIO servers within the application. 3 Make several calls from the frontend application to the backend server. 4 Observe that after a certain number of calls, the backend server stops responding. Expected behavior

The backend server should continue to respond to requests from the frontend application without interruption, regardless of the number of calls made.

Blue101black commented 2 months ago

I get the same issue randomly in our production app.

I've added logging around the StateChanged event on the WebServer that should help identify if we are actually getting the "Stopped" event and then probably look at restarting the server if we get that.

RagibNoor commented 1 month ago

I am not sure if I am doing it the wrong way or not but when I dispose the server there is no log it only shows log when the server initialized and start may I know how did you solve your production issue ?

Blue101black commented 1 month ago

@RagibNoor our production app is a Xamarin forms app with a web view front end.

Still haven't figured out the root cause but done quite a bit to just make sure not hammering EmbedIO.

Added a queue and command store on front-end that basically queues requests to EmbedIO so we don't send multiple requests at same time. But some things we still don't and generally it's around there where we get error.

The latest change is detecting when getting no response from EmbedIO from front-end and send a message through the web view to restart EmbedIo.

Still getting embed io killing itself heaps in production so now doing a proof of concept REST-like API that goes directly through web view instead.

RagibNoor commented 1 month ago

for me with xamarin it's working fine
at this moment i am also looking for alternative of embedio as it's not maintained any more please let me know if you find anything