Skip to content

Subspace subnet_params parallel issue #77

@uy5cu71

Description

@uy5cu71

By default it set parallel=True and it raise RuntimeError: This event loop is already running.

Which is cause later timeout error -> which will cause save state cache with error dictionary:
...."subnets": [{"tempo": {"error": "TimeoutError: 10 seconds"}, "immunity_period": {"error": "TimeoutError: 10 seconds"}, "min_allowed_weights": {"error": "TimeoutError: 10 seconds"},....
-> which will later cause broken modules as they expect integer not dict

Could not get subnet params for SubNetwork 0. Trying 0 more times.
Could not get subnet params for SubNetwork 0. Trying 1 more times.
Could not get subnet params for SubNetwork 0. Trying 0 more times.
Could not get subnet params for SubNetwork 0. Trying 2 more times.
Could not get subnet params for SubNetwork 0. Trying 0 more times.
Could not get subnet params for SubNetwork 0. Trying 1 more times.
Could not get subnet params for SubNetwork 0. Trying 0 more times.
Traceback (most recent call last):
  File "/home/total/commune/commune/modules/subspace/subspace.py", line 837, in subnet_params
    return self.subnet_params(netuid=netuid, network=network, block=block, update=update, trials=trials, timeout=timeout, parallel=parallel, fmt=fmt)
  File "/home/total/commune/commune/modules/subspace/subspace.py", line 884, in subnet_params
    results = c.wait(futures, timeout=timeout)
  File "/home/total/commune/commune/module/module.py", line 6214, in wait
    return c.gather(futures, timeout=timeout)
  File "/home/total/commune/commune/module/module.py", line 6292, in gather
    results = loop.run_until_complete(future)
  File "/home/total/.pyenv/versions/3.9.13/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/home/total/commune/commune/module/module.py", line 6284, in wait_for
    result = await asyncio.wait_for(future, timeout=timeout)
  File "/home/total/.pyenv/versions/3.9.13/lib/python3.9/asyncio/tasks.py", line 479, in wait_for
    return fut.result()
  File "/home/total/commune/commune/modules/subspace/subspace.py", line 852, in query
    return self.query(**kwargs)
  File "/home/total/commune/commune/modules/subspace/subspace.py", line 282, in query
    self.put(cache_path, value)
  File "/home/total/commune/commune/module/module.py", line 398, in put
    getattr(cls,f'put_{mode}')(k, data)
  File "/home/total/commune/commune/module/module.py", line 1815, in put_json
    return loop.run_until_complete(cls.async_put_json(*args, **kwargs))
  File "/home/total/.pyenv/versions/3.9.13/lib/python3.9/asyncio/base_events.py", line 623, in run_until_complete
    self._check_running()
  File "/home/total/.pyenv/versions/3.9.13/lib/python3.9/asyncio/base_events.py", line 583, in _check_running
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running

If set parallel=False - issue is gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions