From 7086cf14671652b39b10651339840952ff38120d Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Tue, 28 Apr 2026 17:57:41 +0200 Subject: [PATCH 1/2] Change http server order start --- src/opengnsys/service.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/opengnsys/service.py b/src/opengnsys/service.py index f9b4292..4ed2d3e 100644 --- a/src/opengnsys/service.py +++ b/src/opengnsys/service.py @@ -146,11 +146,8 @@ class CommonService(object): self.ipc = ipc.ServerIPC(self.ipcport, clientMessageProcessor=self.clientMessageProcessor) self.ipc.start() - # And http threaded server - self.httpServer = httpserver.HTTPServerThread(self.address, self) - self.httpServer.start() - - # And lastly invoke modules activation + # Activate modules before exposing the HTTP server so that no request + # arrives before the secret has been sent to ogcore via ogagent/started. validMods = [] for mod in self.modules: try: @@ -160,11 +157,15 @@ class CommonService(object): except Exception as e: logger.exception() logger.debug("Activation of {} failed: {}".format(mod.name, exceptionToMessage(e))) - + self.modules[:] = validMods # copy instead of assignment - + logger.debug('Modules after activation: {}'.format(list(v.name for v in self.modules))) + # Start HTTP server only after all modules are active and ogcore knows the secret. + self.httpServer = httpserver.HTTPServerThread(self.address, self) + self.httpServer.start() + def terminate(self): # First invoke deactivate on modules for mod in reversed(self.modules): From 22a1206f068ca9fb6baa27941c6c5759b22556b0 Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Tue, 28 Apr 2026 17:59:24 +0200 Subject: [PATCH 2/2] Updated CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6199d66..ffe3368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [8.5.1] - 2026-04-28 + +### Fixed + +- Start the HTTP server after all modules complete activation, so that ogcore commands never arrive before the new secret has been communicated via `ogagent/started` + ## [8.5.0] - 2026-03-23 ### Added