1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-13 20:08:55 +00:00

Handling server disconnect error when docker daemon die

Fix #985
This commit is contained in:
Julien Duponchelle 2017-04-24 17:37:41 +02:00
parent c9ceeee9de
commit 8b9f22c30c
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -20,10 +20,10 @@ Docker server module.
"""
import sys
import json
import asyncio
import logging
import aiohttp
import json
from gns3server.utils import parse_version
from gns3server.utils.asyncio import locked_coroutine
from gns3server.compute.base_manager import BaseManager
@ -189,7 +189,10 @@ class Docker(BaseManager):
# The pull api will stream status via an HTTP JSON stream
content = ""
while True:
chunk = yield from response.content.read(1024)
try:
chunk = yield from response.content.read(1024)
except aiohttp.errors.ServerDisconnectedError:
break
if not chunk:
break
content += chunk.decode("utf-8")