Derecho-Project / derecho

The main code repository for the Derecho project.
BSD 3-Clause "New" or "Revised" License
187 stars 47 forks source link

Discouraging using`exit()` in/with Derecho #174

Closed songweijia closed 3 years ago

songweijia commented 4 years ago

Derecho has some global variable singletons (like sst::util::polling_data). The exit() or std::exit() is very rude by terminating the application forcefully. One thing it does is to destroy all the global variables. Therefore, if a thread calls exit() to terminate, it will destroy the global resources other live threads reply on, resulting in a cascade of wried annoying error messages. An infamous one is put_with_completion() failure because of destroyed singleton sst::util::polling_data. We should remove the exit() from Derecho (I found some in my libfabric code and others in the sample code.). We also need to document this in the sample files to discourage using exit() in derecho application, especially in the stability callbacks.