From f8fa2024ed2bf6c7dc70752bd883c9feae3115be Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Thu, 20 Jun 2019 11:46:07 -0700 Subject: add intersphinx inventory --- docs/conf.py | 2 +- docs/objects.inv | Bin 0 -> 1909 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 docs/objects.inv diff --git a/docs/conf.py b/docs/conf.py index babb8c4a..54b5bc00 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -35,7 +35,7 @@ from glances import __version__ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. #extensions = ['sphinxcontrib.autohttp.bottle'] -extensions = [] +extensions = ['sphinx.ext.intersphinx'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/objects.inv b/docs/objects.inv new file mode 100644 index 00000000..cca4aa50 Binary files /dev/null and b/docs/objects.inv differ -- cgit v1.2.3 From d8f7109182dc246fb8f0b183199e611e9470e0e7 Mon Sep 17 00:00:00 2001 From: Joe Abbey Date: Tue, 2 Jul 2019 13:22:18 -0400 Subject: Improve error handling when docker restarts --- glances/plugins/glances_docker.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/glances/plugins/glances_docker.py b/glances/plugins/glances_docker.py index cd658680..3e628788 100644 --- a/glances/plugins/glances_docker.py +++ b/glances/plugins/glances_docker.py @@ -167,6 +167,10 @@ class Plugin(GlancesPlugin): except Exception as e: # Correct issue#649 logger.error("{} plugin - Cannot get Docker version ({})".format(self.plugin_name, e)) + # We may have lost connection remove version info + if 'version' in self.stats: + del self.stats['version'] + self.stats['containers'] = [] return self.stats # Update current containers list @@ -176,6 +180,8 @@ class Plugin(GlancesPlugin): containers = self.docker_client.containers.list(all=self._all_tag()) or [] except Exception as e: logger.error("{} plugin - Cannot get containers list ({})".format(self.plugin_name, e)) + # We may have lost connection empty the containers list. + self.stats['containers'] = [] return self.stats # Start new thread for new container @@ -653,11 +659,15 @@ class ThreadDockerGrabber(threading.Thread): Infinite loop, should be stopped by calling the stop() method """ - for i in self._stats_stream: - self._stats = i - time.sleep(0.1) - if self.stopped(): - break + try: + for i in self._stats_stream: + self._stats = i + time.sleep(0.1) + if self.stopped(): + break + except: + logger.debug("docker plugin - Exception thrown during run") + self.stop() @property def stats(self): -- cgit v1.2.3