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

close synchronosuly on __del__ #1700

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Conversation

ifrit98
Copy link
Contributor

@ifrit98 ifrit98 commented Feb 12, 2024

Misleading Error only occurs in python 3.11:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /example.py:4 in <module>                                                                        │
│                                                                                                  │
│    1 import torch                                                                                │
│    2 import bittensor as bt                                                                      │
│    3 dendrite = bt.dendrite( )                                                                   │
│ ❱  4 raise Exception('Raise random exception.')                                                  │
│    5                                                                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
Exception: Raise random exception.
Exception ignored in: <function dendrite.__del__ at 0x29bcb7600>
Traceback (most recent call last):
  File ".../bittensor/dendrite.py", line 815, in __del__
TypeError: 'NoneType' object is not callable

Actually caused by dendrite.aclosesession not awaited under the hood.

Fixed by simply using synchronous dendrite.closesession() in __del__ desctructor.

@ifrit98 ifrit98 marked this pull request as ready for review February 12, 2024 17:13
@ifrit98 ifrit98 merged commit 9a0cd4f into staging Feb 12, 2024
9 checks passed
@unconst unconst deleted the bugfix/dendrite-del-none-err branch March 27, 2024 20:03
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 this pull request may close these issues.

None yet

2 participants