fix_http_server_start #71
|
|
@ -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/),
|
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).
|
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
|
## [8.5.0] - 2026-03-23
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -146,11 +146,8 @@ class CommonService(object):
|
||||||
self.ipc = ipc.ServerIPC(self.ipcport, clientMessageProcessor=self.clientMessageProcessor)
|
self.ipc = ipc.ServerIPC(self.ipcport, clientMessageProcessor=self.clientMessageProcessor)
|
||||||
self.ipc.start()
|
self.ipc.start()
|
||||||
|
|
||||||
# And http threaded server
|
# Activate modules before exposing the HTTP server so that no request
|
||||||
self.httpServer = httpserver.HTTPServerThread(self.address, self)
|
# arrives before the secret has been sent to ogcore via ogagent/started.
|
||||||
self.httpServer.start()
|
|
||||||
|
|
||||||
# And lastly invoke modules activation
|
|
||||||
validMods = []
|
validMods = []
|
||||||
for mod in self.modules:
|
for mod in self.modules:
|
||||||
try:
|
try:
|
||||||
|
|
@ -160,11 +157,15 @@ class CommonService(object):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception()
|
logger.exception()
|
||||||
logger.debug("Activation of {} failed: {}".format(mod.name, exceptionToMessage(e)))
|
logger.debug("Activation of {} failed: {}".format(mod.name, exceptionToMessage(e)))
|
||||||
|
|
||||||
self.modules[:] = validMods # copy instead of assignment
|
self.modules[:] = validMods # copy instead of assignment
|
||||||
|
|
||||||
logger.debug('Modules after activation: {}'.format(list(v.name for v in self.modules)))
|
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):
|
def terminate(self):
|
||||||
# First invoke deactivate on modules
|
# First invoke deactivate on modules
|
||||||
for mod in reversed(self.modules):
|
for mod in reversed(self.modules):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue