Skip to content

samples: net: sockets: http_server: Dont block system workq #93537

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

Merged

Conversation

decsny
Copy link
Member

@decsny decsny commented Jul 22, 2025

Since the netstats handler calls on functions which reach deep into the networking stack, there is a lot of points actually at which it can be blocked, even forever. So having this handler on the system workqueue is not a good idea and can even cause a deadlock in some cases if it's blocked waiting on a synchronization primitive that would be given by a work item scheduled later in the queue. Therefore, make a workqueue specifically for this http server socket instead of using the system one.

Fixes #92652

Since the netstats handler calls on functions which reach deep into the
networking stack, there is a lot of points actually at which it can be
blocked, even forever. So having this handler on the system workqueue is
not a good idea and can even cause a deadlock in some cases if it's
blocked waiting on a synchronization primitive that would be given by a
work item scheduled later in the queue. Therefore, make a workqueue
specifically for this http server socket instead of using the system
one.

Signed-off-by: Declan Snyder <[email protected]>
Copy link

@cfriedt cfriedt merged commit fb0ca16 into zephyrproject-rtos:main Jul 25, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: HTTP HTTP client/server support area: Networking area: Samples Samples area: Sockets Networking sockets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"No new RX buf available" error in sample Echo and HttpServer applications when running on FRDM_N947 boards
6 participants