View Issue Details

IDProjectCategoryView StatusLast Update
0007192libmicrohttpdlibmicrohttpd internal selectpublic2022-03-17 12:07
Reporterdro Assigned To 
PrioritynormalSeverityminorReproducibilitysometimes
Status newResolutionopen 
Platformarm64OSDebianOS Version9.10
Product Version0.9.72 
Summary0007192: Notify complete callback sometimes not called when connection is closed prematurely while using epoll internal thread
DescriptionWhen using MHD_USE_EPOLL_INTERNAL_THREAD, the callback specified using MHD_OPTION_NOTIFY_COMPLETED is sometimes not called when a connection is closed mid transfer of a large POST request, even though the MHD_AccessHandlerCallback has already been called. I have tested using the versions in the Buster and Bullseye Debian repositories (0.9.62-1 and 0.9.72-2), and the behaviour is the same. When I run the server using MHD_USE_POLL_INTERNAL_THREAD instead, the callback is correctly called every time.
Steps To ReproduceStart a libmicrohttpd server using MHD_USE_EPOLL_INTERNAL_THREAD, and define a MHD_OPTION_NOTIFY_COMPLETED callback.

MHD_start_daemon(MHD_USE_EPOLL_INTERNAL_THREAD, port, NULL, NULL, &handler, info, MHD_OPTION_THREAD_POOL_SIZE, 8, MHD_OPTION_NOTIFY_COMPLETED, &complete_callback, NULL, MHD_OPTION_NOTIFY_CONNECTION, &connnection_callback, NULL, MHD_OPTION_END);

I use curl to post a 1GB file to the server, and at some point in the middle of the transfer, I use ctrl+\ to send a SIGQUIT to curl. The "complete_callback" is only intermittently called in this instance when using EPOLL, but changing to using POLL means that it is called every time.
TagsNo tags attached.

Activities

Christian Grothoff

2022-03-15 02:06

manager   ~0018791

Do you have a nice (simple) test? Does the problem exist in Git master?

Christian Grothoff

2022-03-17 12:07

manager   ~0018802

Marco Boss just reported something that might be related (missing notify cleanup) against the same MHD version for the G5k benchmarks.

Issue History

Date Modified Username Field Change
2022-03-11 11:40 dro New Issue
2022-03-15 02:06 Christian Grothoff Note Added: 0018791
2022-03-17 12:07 Christian Grothoff Note Added: 0018802