eddic / fastcgipp

fastcgi++: A C++ FastCGI and Web development platform:
https://fastcgipp.isatec.ca
GNU Lesser General Public License v3.0
310 stars 94 forks source link

Sould not register signal handlers #106

Closed Finkman closed 2 years ago

Finkman commented 3 years ago

Our application, using the fastcgipp lib, was no longer handling the SIGTERM signal. After a long journey of debugging we found out, that the fastcgipp lib registers various of signal handler which overwrite our handlers. IMHO, that's a design flaw. Signals should be handled by the process, since it is the only why the catch crucial system events and messages.

Proposed Solution

Use concept of RAII and handle instance::terminate as a part of destruction process.

eddic commented 3 years ago

As far as I recall the signals are not implicitly set up. The appropriate function needs to be called to setup the libraries signal handling. If you don't want to use said signal handling don't call the function.

Finkman commented 3 years ago

In which cases is it required to call that function. What is it purpose and how can we figure out if we should/shouldn't or must/mustn't call setupSignals?

eddic commented 3 years ago

Well that's up to you. If your application is setting up signal handlers internally, don't call it. If you want to use the default signal handlers provided by the library, call it.