Skip to content

Attribute error: 'MicroserviceRegisterWorker' object has no attribute 'deinit' #5

@Relrin

Description

@Relrin

When the Sanic framework is using the sanic-amqp-extension package and register a custom worker which is registering microservice, before stopping the server it throws an error for deinitialization.
Error traceback from game-servers-pool microservice:

Traceback (most recent call last):
  File "./manage.py", line 14, in <module>
    manager.run()
  File "/usr/local/lib/python3.6/site-packages/sanic_script/__init__.py", line 350, in run
    result = self.handle(argv[0], argv[1:])
  File "/usr/local/lib/python3.6/site-packages/sanic_script/__init__.py", line 319, in handle
    res = handle(*args, **config)
  File "/usr/local/lib/python3.6/site-packages/sanic_script/commands.py", line 195, in __call__
    return self.run(*args, **kwargs)
  File "/app/app/commands/run_server.py", line 23, in run
    workers=self.app.config["APP_WORKERS"],
  File "/usr/local/lib/python3.6/site-packages/sanic/app.py", line 646, in run
    serve(**server_settings)
  File "/usr/local/lib/python3.6/site-packages/sanic/server.py", line 648, in serve
    trigger_events(after_stop, loop)
  File "/usr/local/lib/python3.6/site-packages/sanic/server.py", line 496, in trigger_events
    loop.run_until_complete(result)
  File "uvloop/loop.pyx", line 1364, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.6/site-packages/sanic_amqp_ext/__init__.py", line 86, in aioamqp_free_resources
    await worker.deinit()
AttributeError: 'MicroserviceRegisterWorker' object has no attribute 'deinit'

To fix this issue will be necessary to implement the async deinit method, which is calling by the sanic-amqp-extension

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions