Add CTE LL-DASH ingest publisher#15
Conversation
| #endif | ||
| } | ||
|
|
||
| void LiveDashIngestServer::stop() { |
There was a problem hiding this comment.
Noticed that stop() shuts down the listen socket and then joins all worker threads. In a scenario (e.g. a stalled encoder, interrupted network connection etc. ) where worker threads may still be blocked in recv() on already accepted client sockets, this could cause shutdown to hang if a client connects but does not finish sending the request/body.
One possible consideration could be to track active client sockets and shut them down during stop(), or use receive timeouts / non-blocking IO so worker threads can exit cleanly.
There was a problem hiding this comment.
Fixed in dcb2a4b. LiveDashIngestServer::stop() now tracks active accepted client sockets and shuts them down before joining worker threads, so a stalled chunked request blocked in recv() no longer hangs shutdown. Added a regression test that opens a partial chunked PUT, calls stop(), and verifies it returns without waiting for the client to finish the body.
| close_fd(client_fd); | ||
| break; | ||
| } | ||
| worker_threads.emplace_back([this, client_fd]() { |
There was a problem hiding this comment.
Noticed that each accepted connection appends a new worker thread, and completed workers seem to be joined only during stop(). In a long-running ingest server with many reconnects/requests, it could cause worker_threads to keep growing for the lifetime of the process
One possible consideration could be to periodically reap completed workers.
There was a problem hiding this comment.
Fixed in dcb2a4b. Completed workers now mark themselves done, and the accept loop reaps/join-removes completed worker records before adding another accepted connection. stop() still joins any remaining active workers after shutting down the listen socket and active clients.
|
I've run it: |
|
Follow-up for @piersoh's FFmpeg usage: dcb2a4b adds a live DASH ingest regression test based on that shape. The test uses FFmpeg-style representation paths under the ingest prefix ( I also probed the minimized FFmpeg command locally and confirmed that the DASH muxer writes |
Summary
Test Plan