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

"Exception ignored " #485

Open
meejah opened this issue Jan 8, 2022 · 6 comments
Open

"Exception ignored " #485

meejah opened this issue Jan 8, 2022 · 6 comments

Comments

@meejah
Copy link

meejah commented Jan 8, 2022

I'm seeing this traceback in an @eliot.twisted.inline_callbacks-decorated method .. I'm not sure exactly what is happening yet and some initial attempts to re-create the error with a smaller test-case hasn't exhibited the problem.

Exception ignored in: <generator object RemoteScannerService._poll_collective at 0x7f0f7cb277b0>        
Traceback (most recent call last):                                                                        
  File "/home/meejah/work/leastauthority/src/magic-folder/venv3/lib/python3.9/site-packages/eliot/_genera$ors.py", line 111, in wrapper                                                                             
    value_out = context.run(go)                                                                           
  File "/home/meejah/work/leastauthority/src/magic-folder/venv3/lib/python3.9/site-packages/eliot/_genera$ors.py", line 99, in go                                                                                   
    value_out = gen.throw(*value_in)                                                                      
  File "/home/meejah/work/leastauthority/src/magic-folder/src/magic_folder/downloader.py", line 518, in _$oll_collective                                                                                            
    yield gatherResults([                                                                              
  File "/home/meejah/work/leastauthority/src/magic-folder/venv3/lib/python3.9/site-packages/eliot/_action$py", line 434, in __exit__                                                                                
    self.finish(exception)                                                     
  File "/home/meejah/work/leastauthority/src/magic-folder/venv3/lib/python3.9/site-packages/eliot/_action$py", line 356, in finish                                                                                  
    self._logger.write(fields, serializer)                                                               
  File "/home/meejah/work/leastauthority/src/magic-folder/venv3/lib/python3.9/site-packages/eliot/_output$py", line 236, in exclusively_f                                                                           
    with self._lock:   

Perhaps this particular test triggers an error, causing some other logging to happen? (The behavior I see is that we're "hung" here, and a ctrl-C gives the above stack .. so could be a deadlock?).

If I remove the two start_action calls from that method, the test passes.

@meejah
Copy link
Author

meejah commented Jan 10, 2022

I can get rid of the first traceback (and see the second more-reliably -- but still not "always") if I decorate the method with just @inlineCallbacks instead of @inline_callbacks..

@itamarst
Copy link
Owner

itamarst commented Apr 29, 2022

I am not sure how much more effort I'm going to put in to @inline_callbacks given the ability to switch to async functions, FWIW, where Eliot contexts should (in theory) just work. Going to test that theory shortly.

@itamarst
Copy link
Owner

itamarst commented May 4, 2022

After further investigation:

  1. You likely don't need @inline_callbacks, Twisted's version should work. It turns out Twisted does contextvars for @inlineCallbacks now...
  2. ... except that there's a bug, fixed by 10301 Fix support for contextvar.reset twisted/twisted#1690

@exarkun
Copy link
Collaborator

exarkun commented Sep 14, 2022

Twisted 22.8 is now out and includes the fix for twisted/twisted#10301

@itamarst
Copy link
Owner

@meejah if you could retry with latest Twisted and normal inlineCallbacks? If that works I will likely just update docs to tell users to use Twisted directly.

@meejah
Copy link
Author

meejah commented Sep 27, 2022

I tried to "retry", but didn't apparently leave enough hints for future-me to determine how exactly to do that.

I used some code from around the same time (and the line-numbers in the trace at least match up) but I couldn't get the exception to happen again.

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

No branches or pull requests

3 participants