diff --git a/control/server.py b/control/server.py index bbfc625d..3fbc9f4c 100644 --- a/control/server.py +++ b/control/server.py @@ -120,8 +120,10 @@ def _wait_for_group_id(self): self.logger.info(f"MonitorGroup server is listening on {self._monitor_address()} for group id") self.monitor_event.wait() self.monitor_event = None - self.logger.info("Stopping the monitor server...") - self.monitor_server.stop(None) + self.logger.info("Stopping the MonitorGroup server...") + grace = self.config.getfloat_with_default("gateway", "monitor_stop_grace", 1/1000) + self.monitor_server.stop(grace).wait() + self.logger.info("The MonitorGroup gRPC server stopped...") self.monitor_server = None def serve(self):