Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inaccurate handling or weak references #755

Closed
ods opened this issue Jun 24, 2021 · 0 comments · Fixed by #758
Closed

inaccurate handling or weak references #755

ods opened this issue Jun 24, 2021 · 0 comments · Fixed by #758

Comments

@ods
Copy link
Collaborator

ods commented Jun 24, 2021

Describe the bug

Observed error:

  File "asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "aiokafka/conn.py", line 387, in _idle_check
    idle_for = time.monotonic() - self._last_action
AttributeError: 'NoneType' object has no attribute '_last_action'

I've got this error almost simultaneously in multiple services connected to the same kafka instance. The most probable reason is a network failure.

There are other places where weak reference is used without check:

Environment:

  • aiokafka version: 0.7.0
ods added a commit to ods/aiokafka that referenced this issue Jun 24, 2021
ods added a commit to ods/aiokafka that referenced this issue Jun 24, 2021
@ods ods closed this as completed in #758 Jul 9, 2021
ods added a commit that referenced this issue Jul 9, 2021
* Check weak refs before use (fixes #755)

* Limit lifetime of self-s we get from weakref
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant