You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use of SIGKILL inside UnixConnetion.cpp forcibly shuts down the process without giving it a chance to clean up. Thus, atexit handlers, such as the ShutdownHooks inside Log.java of the Java kit, do not have a chance to run. While I am not as familiar with process signalling on Windows, this article form Dr. Dobbs suggests that TerminateProcess in WinConnection.cpp is equally dangerous.
My suggestion would be using a gentler process of sending SIGTERM (and its Windows equivalent) to give the process a chance to clean up, and then using forcible termination after a short delay if the process hasn't exited by then. This allows higher level languages to perform internal cleanup operations and would also allow users to write their own cleanup functions, e.g. to flush log files.
The text was updated successfully, but these errors were encountered:
Currently processes are forcefully terminated at the end of the game.
Halite-III/game_engine/networking/unix/UnixConnection.cpp
Lines 89 to 91 in 7b7deb7
Halite-III/game_engine/networking/win32/WinConnection.cpp
Lines 99 to 110 in 7b7deb7
The use of
SIGKILL
insideUnixConnetion.cpp
forcibly shuts down the process without giving it a chance to clean up. Thus, atexit handlers, such as the ShutdownHooks insideLog.java
of the Java kit, do not have a chance to run. While I am not as familiar with process signalling on Windows, this article form Dr. Dobbs suggests thatTerminateProcess
inWinConnection.cpp
is equally dangerous.My suggestion would be using a gentler process of sending
SIGTERM
(and its Windows equivalent) to give the process a chance to clean up, and then using forcible termination after a short delay if the process hasn't exited by then. This allows higher level languages to perform internal cleanup operations and would also allow users to write their own cleanup functions, e.g. to flush log files.The text was updated successfully, but these errors were encountered: