Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default wait time to 0 (no wait) to enqueue tcp events #26

Closed
wants to merge 1 commit into from

Conversation

mathieucarbou
Copy link
Member

No description provided.

@mathieucarbou mathieucarbou self-assigned this Feb 7, 2025
@mathieucarbou mathieucarbou requested a review from a team February 7, 2025 23:48
@vortigont
Copy link

do not think that it's a good idea here, those functions here are called by LWIP and it is more critical to try best not to miss those events by default. It could block and wait while asynctcp's task is running on evicting the events from a queue, so there should not be a deadlock condition. The exception cases for poll events are called with 0 timeout.
We could probably set some reasonable timeout of several seconds here instead of portMAX_DELAY in case watchdog is disabled for asynctcp task.

@mathieucarbou
Copy link
Member Author

mathieucarbou commented Feb 8, 2025

@vortigont : that is something we played around with @me-no-dev yesterday, with also the log pr (#24). We were able to see the events being discarded on a full queue of 64 and by adding a delay of 3 sec in the onBody to slow down request processing (data tcp event).

autocannon -c 32 -w 32 -a 96 -t 30 --renderStatusCodes -m POST -H "Content-Type: application/json" -b '{"game": "test"}' http://192.168.4.1/game_log

and doing some normal curl get at the same time.

Otherwise in normal case, all works fine, with a lot of concurrent requests also.

The idea being to remove any wait time and if queue is full, see when it happens and if it happens, maybe abort requests.
What we saw is that this is quite hard to produce a case that will exhaust the queue , even with size 64.

@mathieucarbou mathieucarbou deleted the wait branch February 8, 2025 09:12
@me-no-dev
Copy link
Member

those functions here are called by LWIP and it is more critical to try best not to miss those events by default.

at the same time we do not want to block LwIP. There are other ways to handle the missed events. You will block LwIP because another client can't push it's event and thus also prevent the running one (that is halting the thread for too long) to also not be able to complete

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