Skip to content

Commit

Permalink
fix: [CI] server crash
Browse files Browse the repository at this point in the history
WORKAROUND: cannot receive SIGTERM when shutdown or reboot

Log: fix CI

Bug: https://pms.uniontech.com/bug-view-228373.html
  • Loading branch information
Johnson-zs committed Jan 3, 2024
1 parent dbba9f3 commit 9cad874
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/apps/dde-file-manager-server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <QDir>

#include <signal.h>
#include <unistd.h>

Q_LOGGING_CATEGORY(logAppServer, "log.app.dde-file-manager-server")

Expand Down Expand Up @@ -92,6 +93,14 @@ static void handleSIGTERM(int sig)
}
}

[[noreturn]] static void handleSIGABRT(int sig)
{
qCCritical(logAppServer) << "break with !SIGABRT! " << sig;
// WORKAROUND: cannot receive SIGTERM when shutdown or reboot
// see: bug-228373
::_exit(1);
}

DWIDGET_USE_NAMESPACE

int main(int argc, char *argv[])
Expand All @@ -107,6 +116,7 @@ int main(int argc, char *argv[])
}

signal(SIGTERM, handleSIGTERM);
signal(SIGABRT, handleSIGABRT);

DPF_NAMESPACE::backtrace::installStackTraceHandler();
initLog();
Expand Down

0 comments on commit 9cad874

Please sign in to comment.