You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have included information about relevant versions
I have verified that the issue persists when using the master branch of Mode.
Steps to reproduce
Define any simple async function
Create a mode.threads.QueueServiceThread and call its start() method.
Call the async function with service.
Prepare a debugger with breakpoints at two locations:
-- The beginning of MethodQueue, currently line 331 of mode/threads.py
-- The if self._loop is None block of ServiceBase's loop@property, currently line 146 of mode/services.py
Run with the debugger
Observe first expected Breakpoint stop
Resume execution
Expected behavior
The program should run to completion without stopping at the second breakpoint at all
Before proceeding to (7), notice that we have passed an explicit event loop argument. I do not expect to need to hit the second breakpoint before the program completes because the event loop is known at this point and I have no further Service initialization to do.
Actual behavior
Given that we have passed a loop argument explicitly to MethodQueue, I would not expect to land in the second breakpoint, especially while the first breakpoint is still on the call stack. But on resuming after the first, expected breakpoint, we land in a second, unexpected stop, with MethodQueue requesting the default event loop to satisfy its own None reference.
Reading the code carefully we can see that MethodQueue does not ever do anything with its EventLoop parameter--neither pass it to its own super.init() method, more to any of its child objects.
I imagine that this code should either not receive an EventLoop argument, or it should pass that argument to its own call to ServiceBase.init() before initializing its Queue and Event objects. I am not sure which solution would be preferred. Although the former seems more consistent with Python 3.8's deprecation of explicit EventLoop arguments, perhaps the latter would be more sensitive to compatibility with Python 3.6 and 3.7 for the time being.
Checklist
master
branch of Mode.Steps to reproduce
-- The beginning of
MethodQueue
, currently line 331 ofmode/threads.py
-- The
if self._loop is None
block ofServiceBase
'sloop
@property
, currently line 146 ofmode/services.py
Expected behavior
The program should run to completion without stopping at the second breakpoint at all
Before proceeding to (7), notice that we have passed an explicit event loop argument. I do not expect to need to hit the second breakpoint before the program completes because the event loop is known at this point and I have no further Service initialization to do.
Actual behavior
Given that we have passed a loop argument explicitly to
MethodQueue
, I would not expect to land in the second breakpoint, especially while the first breakpoint is still on the call stack. But on resuming after the first, expected breakpoint, we land in a second, unexpected stop, withMethodQueue
requesting the default event loop to satisfy its own None reference.Reading the code carefully we can see that MethodQueue does not ever do anything with its EventLoop parameter--neither pass it to its own super.init() method, more to any of its child objects.
I imagine that this code should either not receive an EventLoop argument, or it should pass that argument to its own call to ServiceBase.init() before initializing its Queue and Event objects. I am not sure which solution would be preferred. Although the former seems more consistent with Python 3.8's deprecation of explicit EventLoop arguments, perhaps the latter would be more sensitive to compatibility with Python 3.6 and 3.7 for the time being.
Full traceback
Versions
The text was updated successfully, but these errors were encountered: