Commit Graph
122 Commits
Author SHA1 Message Date
YueGuobin 52c19002f2 fix: bound graceful shutdown and stop notification WebSockets on exit
By default uvicorn waits for open connections forever. A long-lived
streaming response keeps the server waiting after Ctrl+C. One common
case is the MCP Streamable HTTP transport: the client opens a
standalone GET request and the server answers with an SSE stream
(not the old SSE transport). A second Ctrl+C sets force_exit. Uvicorn
then skips the lifespan shutdown, so project and controller cleanup
does not run.

Add timeout_graceful_shutdown. After the timeout uvicorn cancels the
remaining tasks and runs the lifespan shutdown. Also make the four
notification WebSocket handlers stop when app.state.exiting is set.
The HTTP stream handlers already do this.
2026-11-04 00:32:34 +08:00
grossmj 811b45f863 fix: drop Python 3.10 and add Python 3.15 support 2026-10-08 15:14:34 +02:00
Mark Paronyan 3135c8b7e3 refactor: use f-strings in remaining modules, scripts and tests 2026-10-03 19:44:02 +03:00
Mark Paronyan 634189d443 style: sort imports in api and utils modules 2026-10-02 12:43:26 +03:00
Mark Paronyan a0450b6bce refactor: ruff autofixes 2026-09-27 15:55:10 +03:00
Mark Paronyan 8c3aaa78f5 feat(compute): option to disable compute authentication 2026-03-03 00:28:57 +03:00
grossmj 8e96c4c2e8 Refactor command line arguments parsing 2025-01-17 07:57:42 +07:00
grossmj 5269d4386c Drop Python 3.8 2024-12-30 15:36:40 +07:00
grossmj 9b66d939d2 Support for cooperative signal handling of uvicorn v0.29.0 2024-04-03 15:58:10 +07:00
grossmj 31c7fe88f1 Remove websocket.close() 2024-03-16 16:00:27 +01:00
grossmj 0f0412158d Drop support for Python 3.7 and upgrade dependencies 2023-10-22 15:37:00 +10:00
grossmj cefa459721 Fix command line issue with certfile and certkey 2023-08-11 18:34:16 +10:00
grossmj 17f71f970e Add truststore inject_into_ssl 2023-08-10 15:01:49 +10:00
grossmj cd096ac6e6 Backward compatibility for --log argument 2022-04-27 14:15:29 +07:00
grossmj 900d4f79ee "Local" command line parameter is only for stopping
a server that has been started by the desktop GUI
2022-03-30 18:38:34 +08:00
grossmj db739775d0 Drop Python 3.6 support and require Python >= 3.7 2022-03-14 15:13:26 +10:30
grossmj 74c675d5b0 Drop Windows support 2022-01-19 22:28:36 +10:30
grossmj ff64f86289 Fix calls to static methods in server.py 2021-12-15 13:08:18 +10:30
grossmj 38388f7ae5 Secure controller to compute communication using HTTP basic authentication 2021-11-18 18:37:10 +10:30
grossmj 8810249d36 Add user groups support. 2021-05-15 15:10:02 +09:30
grossmj bad3ef7003 Detect the app is exiting and avoid reconnecting to computes. 2021-04-17 18:33:20 +09:30
grossmj c021e21309 Use black with -l 120 param. 2021-04-13 18:46:50 +09:30
grossmj f928738bd5 Use pyupgrade with --py36-plus param. 2021-04-13 18:37:58 +09:30
grossmj 6b0d0de1bc Wait for local compute to be started.
Don't reconnect to local compute when server is being stopped.
2021-04-13 15:41:59 +09:30
grossmj 71725aade6 Rename ssl and auth configuration file settings.
Add enable SSL config validator.
Strict configuration file validation: any error will prevent the server to start.
Core server logic moved to a Server class.
2021-04-12 23:26:42 +09:30
Julien Duponchelle aad69e9650 Create a /server API for register servers
This allow to push to the controller information about
the connection to a server.
2016-03-03 16:05:09 +01:00
Julien Duponchelle c280fd5fb8 Merge branch 'master' into 1.5 2016-01-20 17:10:59 +01:00
Julien Duponchelle f83e878d89 Dump environnement to server debug log
Ref https://github.com/GNS3/gns3-gui/issues/921
2016-01-15 10:11:32 +01:00
Julien Duponchelle 5a28b9409a Fix Crash at startup when docker is not installed
Fix #384
2016-01-06 15:13:22 +01:00
Julien Duponchelle 33edbefa3b Docker cleanup and improvements 2015-12-18 18:20:56 +01:00
Julien Duponchelle 2fbc391319 Force canceling all task when shutdown server
https://bugs.python.org/issue24080

Fix #705
2015-10-16 20:42:13 +02:00
Julien Duponchelle c700804014 Merge branch 'master' into unstable 2015-10-12 17:09:33 +02:00
Julien Duponchelle 91c2bd7e98 Asyncio qemu fix and raise error if coroutine not used 2015-10-12 17:06:50 +02:00
Julien Duponchelle 0a536278fc Fix asyncio error when closing the app
Fix #310, https://github.com/GNS3/gns3-gui/issues/705
2015-10-12 16:16:44 +02:00
Jeremy 4aeb451ffd Makes sure the loop is running when closing the app. 2015-07-26 15:28:14 -06:00
Jeremy 5f5d9347b9 Makes sure the loop is running when closing the app. 2015-07-26 15:27:47 -06:00
Jeremy f1bbacecd6 Backport: Remove timeout to wait for connections to finish. 2015-07-21 18:00:31 -06:00
Jeremy accaa2159b Remove timeout to wait for connections to finish. 2015-07-21 18:00:03 -06:00
Jeremy 19425b1e9c Backport: Fixes RuntimeError: Event loop is closed. 2015-07-21 16:02:44 -06:00
Jeremy 6ee94331d4 Fixes RuntimeError: Event loop is closed. Fixes #266. 2015-07-20 16:02:28 -06:00
Julien Duponchelle 6e88ba4c25 Cleanup SSL certificate support
Fix #208
2015-06-11 17:07:13 +02:00
Julien Duponchelle b7dac1bec4 Force closing the event loop to avoid warning with Python 3.4.3
Fix #177
2015-05-05 11:33:47 +02:00
Jeremy c4054cf810 Catch the "WinError 0 The operation completed successfully" exception at a higher level. 2015-05-04 12:14:04 -06:00
grossmj 343e007809 Ignore the "OSError: [WinError 0] The operation completed successfully" exception in Windows. 2015-04-16 20:17:06 -06:00
Jeremy cf92bfe81e Alternative local server shutdown (mostly intended for Windows). 2015-03-13 18:57:27 -06:00
Jeremy 500b7112f5 Assert host and port are not None when creating the Server instance. 2015-03-12 18:50:38 -06:00
Jeremy 36daa3627e Ignore exception in asyncio loop on Windows when the local server gets a signal. 2015-03-12 18:48:07 -06:00
Jeremy 03796ca729 Server handler to shutdown a local server. 2015-03-12 18:44:05 -06:00
Julien Duponchelle 16dc0d1a8a Send crash report synchronous to avoid lost of events 2015-03-03 12:41:30 +01:00
grossmj 46b0ead329 Close connections for auto-reload. 2015-03-01 21:13:51 -07:00