Skip to content

Updating word lists with talon.cron can cause RuntimeError: dictionary changed size during iteration #120

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

Closed
jgarvin opened this issue Oct 24, 2020 · 4 comments
Labels

Comments

@jgarvin
Copy link

jgarvin commented Oct 24, 2020

I haven't tried to make a minimal test case but was asked to file, so here's what I know :)

Example trace:

   25:                lib/python3.7/threading.py:890| 
   24:                lib/python3.7/threading.py:926| 
   23:                lib/python3.7/threading.py:870| 
   22:                             talon/cron.py:112| 
   21: ---------------------------------------------# cron thread
   20:                             talon/cron.py:77 | 
   19:                   talon/scripting/rctx.py:200| 
   18: ---------------------------------------------# 'cron' user.knausj_talon.mandimus.emacs.snippet:call()
   17:                             talon/cron.py:134| 
   16: user/knausj_talon/mandimus/emacs/query.py:169| self._commit(processed)
   15: user/knausj_talon/mandimus/emacs/query.py:187| self.ctx.lists[f"user.{self.name}_list..
   14:                talon/scripting/context.py:67 | 
   13:                talon/scripting/context.py:223| 
   12:               talon/scripting/registry.py:273| 
   11:               talon/scripting/registry.py:469| 
   10:               talon/scripting/dispatch.py:98 | 
    9:               talon/scripting/dispatch.py:133| 
    8:               talon/scripting/dispatch.py:126| 
    7:                   talon/scripting/rctx.py:202| 
    6: ---------------------------------------------# 'update_lists' main:update_lists()
    5: ---------------------------------------------# stack splice
    4:                   talon/scripting/rctx.py:200| 
    3:          talon/scripting/speech_system.py:215| 
    2:          talon/scripting/speech_system.py:85 | 
    1:                      talon/engines/w2l.py:616| 

Deep in my cron callback I was doing:

self.ctx.lists[f"user.{self.name}_list"] = data.keys()

Which curiously seems mitigated by (haven't had it happen since):

self.ctx.lists[f"user.{self.name}_list"] = list(data.keys())

@lunixbochs
Copy link

Please try the issue again in the beta 105-0.1.2-54

@lunixbochs lunixbochs added the bug label Nov 2, 2020
@lunixbochs
Copy link

I think this has been fixed for a bit, can you try to repro it on the latest beta?

@lunixbochs
Copy link

I do think this is fixed, please reopen if you can repro on beta

@jgarvin
Copy link
Author

jgarvin commented Nov 5, 2020

Sorry for not commenting earlier, since updating I have not seen this error happen again 👍 thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants