gaitutils icon indicating copy to clipboard operation
gaitutils copied to clipboard

Web reports cannot be closed anymore

Open jjnurminen opened this issue 2 months ago • 0 comments

The web report is a Flask app, which eventually runs on localhost using the simple (testing oriented) web server from the werkzeug library. Gaitmenu starts servers in their own threads as reports are opened. Werkzeug used to support shutting down of the server, but not anymore - see https://github.com/pallets/werkzeug/issues/1752

This means that the "close web report" functionality no longer works. As a side effect, it seems that the gaitmenu process does not actually terminate when it's shut down - it seems that the running web server threads prevent the process from shutting down.

One solution could be to run the werkzeug servers in their separate processes, which could be terminated with signals. However at least a straightforward approach using multiprocessing.Process fails due to multiprocessing limitations for passing process data.

Maybe a better solution is to switch to another, more production ready web server - werkzeug is not recommended for production anyway.

Ping @andreyzhd

jjnurminen avatar Dec 16 '24 07:12 jjnurminen