aio-libs / aiodocker

Python Docker API client based on asyncio and aiohttp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DockerEvents impossible to restart

zentarim opened this issue · comments

Long story short

DockerEvents objects can be opened but it cannot be reopened again.
Pull request will be created based on this issue.

  • Expected behaviour:
await subscribe()    # the self.task is started
await stop()         # the self.task is cancelled and wiped
await subscribe()    # the self.task is started
  • Actual behaviour:
await subscribe()    # the self.task is started
await stop()         # the self.task is cancelled but is not wiped
await subscribe()    # self.task is not started. No log data will be collected.

How to reproduce

Can be reproduced at the test_events test start as:

    # Сheck the stop procedure
    docker.events.subscribe()
    await docker.events.stop()

    subscriber = docker.events.subscribe()
    # test body

Your environment

A Centos\Ubuntu Linux various versions.
Python 3.6, 3.7, 3.8