Skip to content

Commit 915c4c7

Browse files
authored
Revert "Fix false crash logs with regression tests (#12783)" (#12793)
This reverts commit dd3455c. Addressing this turns out to be more complicated than it at first appeared. I realize after more testing that while this patch removed the "false" crash log reports, it broke crash log generally. And attempts at fixing that haven't been very fruitful. Maybe we should look into this in the future, but in the meantime I want to restore things to the previous state so that crash logs will at least be created when there is an actual crash.
1 parent dea3657 commit 915c4c7

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/traffic_crashlog/traffic_crashlog.cc

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "tscore/BaseLogFile.h"
3333
#include "tscore/runroot.h"
3434
#include "iocore/eventsystem/RecProcess.h"
35-
#include <poll.h>
3635
#include <unistd.h>
3736

3837
static int syslog_mode = false;
@@ -172,25 +171,6 @@ main(int /* argc ATS_UNUSED */, const char **argv)
172171
return 0;
173172
}
174173

175-
// In wait mode, we need to verify this is a real crash by checking if crash_logger_invoke
176-
// sent us signal info via the pipe. If traffic_server just exited normally, the pipe will be
177-
// closed with no data, and we should exit without logging a false "crash".
178-
if (wait_mode) {
179-
// Use poll to check if there's data available on stdin without blocking indefinitely.
180-
struct pollfd pfd;
181-
pfd.fd = STDIN_FILENO;
182-
pfd.events = POLLIN;
183-
184-
// Wait briefly for data. If crash_logger_invoke was called, data should already be there.
185-
int poll_result = poll(&pfd, 1, 100); // 100ms timeout
186-
187-
// POLLHUP means the write end of the pipe was closed - normal exit, not crash.
188-
// No data or error also means no crash occurred.
189-
if (poll_result <= 0 || (pfd.revents & POLLHUP) || !(pfd.revents & POLLIN)) {
190-
return 0;
191-
}
192-
}
193-
194174
runroot_handler(argv);
195175
Layout::create();
196176
RecProcessInit(nullptr /* diags */);

0 commit comments

Comments
 (0)