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

[fix](reader): fix play-all may fail due to 'ValueError: generator already executing' #882

Merged
merged 2 commits into from
Nov 16, 2024

Conversation

cosven
Copy link
Member

@cosven cosven commented Nov 16, 2024

'播放全部' may fail due to

[2024-11-16 21:49:48,867 feeluown.task:85] [ERROR]: Task play-all failed
Traceback (most recent call last):
  File "/Users/xxx/code/feeluown/feeluown/task.py", line 81, in _cb
    future.result()
  File "/Users/xxx/code/feeluown/.venv/lib/python3.11/site-packages/qasync/__init__.py", line 150, in run
    r = callback(*args, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/code/feeluown/feeluown/utils/reader.py", line 173, in readall
    list(self)
  File "/Users/xxx/code/feeluown/feeluown/utils/reader.py", line 98, in __next__
    return self._read_next()
           ^^^^^^^^^^^^^^^^^
  File "/Users/xxx/code/feeluown/feeluown/utils/reader.py", line 192, in _read_next
    obj = next(self._g)
          ^^^^^^^^^^^^^
ValueError: generator already executing
[2024-11-16 21:49:48,871 qasync._QEventLoop:739] [ERROR]: Task exception was never retrieved
future: <Task finished name='Task-88455' coro=<TableContainer.play_all() done, defined at /Users/xxx/code/feeluown/feeluown/gui/page_containers/table
.py:420> exception=ValueError('generator already executing')>
Traceback (most recent call last):
  File "/Users/xxx/code/feeluown/feeluown/gui/page_containers/table.py", line 432, in play_all
    songs = await task_spec.bind_blocking_io(reader.readall)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: generator already executing

'播放全部' may fail due to
```
[2024-11-16 21:49:48,867 feeluown.task:85] [ERROR]: Task play-all failed
Traceback (most recent call last):
  File "/Users/xxx/code/feeluown/feeluown/task.py", line 81, in _cb
    future.result()
  File "/Users/xxx/code/feeluown/.venv/lib/python3.11/site-packages/qasync/__init__.py", line 150, in run
    r = callback(*args, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/code/feeluown/feeluown/utils/reader.py", line 173, in readall
    list(self)
  File "/Users/xxx/code/feeluown/feeluown/utils/reader.py", line 98, in __next__
    return self._read_next()
           ^^^^^^^^^^^^^^^^^
  File "/Users/xxx/code/feeluown/feeluown/utils/reader.py", line 192, in _read_next
    obj = next(self._g)
          ^^^^^^^^^^^^^
ValueError: generator already executing
[2024-11-16 21:49:48,871 qasync._QEventLoop:739] [ERROR]: Task exception was never retrieved
future: <Task finished name='Task-88455' coro=<TableContainer.play_all() done, defined at /Users/xxx/code/feeluown/feeluown/gui/page_containers/table
.py:420> exception=ValueError('generator already executing')>
Traceback (most recent call last):
  File "/Users/xxx/code/feeluown/feeluown/gui/page_containers/table.py", line 432, in play_all
    songs = await task_spec.bind_blocking_io(reader.readall)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: generator already executing
```
@cosven cosven changed the title [fix](reader): make reader thread safe [fix](reader): fix play-all may fail due to 'ValueError: generator already executing' Nov 16, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11870752804

Details

  • 8 of 8 (100.0%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 57.058%

Files with Coverage Reduction New Missed Lines %
feeluown/library/library.py 5 67.16%
Totals Coverage Status
Change from base Build 11823768434: -0.01%
Covered Lines: 9842
Relevant Lines: 17249

💛 - Coveralls

@cosven cosven merged commit 610996a into feeluown:master Nov 16, 2024
7 of 9 checks passed
@cosven cosven deleted the play-all branch November 16, 2024 14:31
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.

2 participants