commit a03dc6d37b8bc4ef20c08bdb28de0de28c3c3939 from: Aleksey Ryndin date: Sun Sep 15 16:25:51 2024 UTC Wait VGI process on error commit - cecb9634543bc4513d89b49feb721eced447a0ba commit + a03dc6d37b8bc4ef20c08bdb28de0de28c3c3939 blob - 1eeaa8b86685d1599f7b69674d56f6a199c19618 blob + e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 --- TODO +++ TODO @@ -1 +0,0 @@ -* VGI "zombie" after TLS write/close failed blob - 6d162f2bc840222a2c618fb6cdb8e31ee55c57d1 blob + 4d8971e971a9d889a8ff134f0793d489f9b120b6 --- vostok/vostok.cc +++ vostok/vostok.cc @@ -177,13 +177,17 @@ process_gateway_request( error::occurred("Read from stdout of the child process", error::Print{}); if (!was_write) send_response(accepted_client.get_ctx(), gemini::STATUS_42_CGI_ERROR, meta::TEMPORARY_FAILURE); - return; + break; } const auto readed = static_cast(ret); if (readed == 0) break; // EOF if (!transport::send(accepted_client.get_ctx(), Span{buffer.data(), readed})) - return; + { + while(read(stdout_read.get(), buffer.data(), buffer.size()) > 0) + ; + break; + } was_write = true; }