Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Exception on stress test for setModel #967

Open
mrosanes opened this issue Jul 25, 2019 · 4 comments
Open

Exception on stress test for setModel #967

mrosanes opened this issue Jul 25, 2019 · 4 comments
Labels
bug py3 This issu affects especifically to python3 support
Milestone

Comments

@mrosanes
Copy link
Collaborator

When performing manual tests for release Jul19, on a taurus-vagrant win10 machine (https://git.cells.es/controls/taurus-vagrant), with conda environment py3qt5.

By deleting character by character the two model names appearing at demo LCD disply at a fast pace, I got this error. Not always reproduced (maybe 50% of times).

TimerLoop 1    ERROR    2019-07-25 05:35:23,475 TaurusPollingTimer[3000]: poll_reply error
Exception in thread TimerLoop 1:
Traceback (most recent call last):
  File "c:\miniconda\envs\py3qt5\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "c:\miniconda\envs\py3qt5\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "c:\miniconda\envs\py3qt5\lib\site-packages\taurus\core\util\timer.py", line 91, in __run
    self.__function(*self.__args, **self.__kwargs)
  File "c:\miniconda\envs\py3qt5\lib\site-packages\taurus\core\tauruspollingtimer.py", line 136, in _pollAttributes
    for dev, attrs in self.dev_dict.items():
RuntimeError: dictionary changed size during iteration

Other error:
By changing the model name, foreground role, etc. the application crashes: not easily reproducible.

@mrosanes mrosanes added bug py3 This issu affects especifically to python3 support windows this issue affects specifically to windows systems labels Jul 25, 2019
@cpascual cpascual changed the title win10 py3qt5 taurus demo LCD error Exception on stress test for setModel Jul 25, 2019
@cpascual
Copy link
Member

cpascual commented Jul 25, 2019

I change the title because it can be reproduced also on debian, and using a TaurusLabel, with the following snippet that just does a stress test on setting models:

from taurus.qt.qtgui.application import TaurusApplication
from taurus.qt.qtgui.display import TaurusLabel


import sys
app = TaurusApplication(cmd_line_parser=None)

w = TaurusLabel()
w.resize(300,100)
w.show()

def loopmodels(model = 'sys/tg_test/1/double_scalar'):
    for _ in range(100):
        for i in range(len(model), -1, -1):
            print(i, model[:i])
            w.setModel(model[:i])
            app.processEvents()
    w.setModel(model)

loopmodels()

Running this on a debian9 with py3qt5 results in:

$ python stress.py
MainThread     INFO     2019-07-25 15:45:27,634 TaurusRootLogger: Using PyQt5 (v5.6 with Qt 5.6.2 and Python 3.6.8)
MainThread     INFO     2019-07-25 15:45:27,885 taurus.qt.qtgui.icon.icon: Setting Tango icon theme (from /nfs/home/cpascual/src/taurus/lib/taurus/qt/qtgui/icon/)
MainThread     INFO     2019-07-25 15:45:28,139 TaurusRootLogger: Plugin "taurus_pyqtgraph" loaded as "taurus.qt.qtgui.tpg"
27 sys/tg_test/1/double_scalar
26 sys/tg_test/1/double_scala
25 sys/tg_test/1/double_scal
24 sys/tg_test/1/double_sca
TimerLoop 1    WARNING  2019-07-25 15:45:31,788 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
23 sys/tg_test/1/double_sc
Exception in thread TimerLoop 1:
Traceback (most recent call last):
  File "/home/cpascual/miniconda/envs/py3qt5/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/cpascual/miniconda/envs/py3qt5/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/nfs/home/cpascual/src/taurus/lib/taurus/core/util/timer.py", line 91, in __run
    self.__function(*self.__args, **self.__kwargs)
  File "/nfs/home/cpascual/src/taurus/lib/taurus/core/tauruspollingtimer.py", line 136, in _pollAttributes
    for dev, attrs in self.dev_dict.items():
RuntimeError: dictionary changed size during iteration

22 sys/tg_test/1/double_s
21 sys/tg_test/1/double_
(...)
2 sy
1 s
0 
(...)
24 sys/tg_test/1/double_sca
TimerLoop 1    WARNING  2019-07-25 15:45:38,654 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
23 sys/tg_test/1/double_sc
(...)
15 sys/tg_test/1/d
terminate called after throwing an instance of 'Tango::DevFailed'
Aborted

@cpascual cpascual removed the windows this issue affects specifically to windows systems label Jul 25, 2019
@cpascual
Copy link
Member

cpascual commented Jul 25, 2019

Notes:

  • I cannot reproduce it using Py 2
  • Using PyQt4 or PyQt5 does not seem to affect
  • I cannot reproduce it using an eval model instead of a tango model, but it fails with any tango model, even non-existing ones

@cpascual
Copy link
Member

cpascual commented Jul 25, 2019

It can be reproduced with an even simpler snippet:

from taurus.qt.qtgui.application import TaurusApplication
from taurus.qt.qtgui.container import TaurusWidget

app = TaurusApplication(cmd_line_parser=None)
w = TaurusWidget()
w.show()

def loopmodels():
    for i in range(1000):
        w.setModel('a/b/c/{}'.format(i%2))
        app.processEvents()

loopmodels()
$ python3 stress3.py 
MainThread     INFO     2019-07-25 16:37:02,159 TaurusRootLogger: Using PyQt5 (v5.6 with Qt 5.6.2 and Python 3.6.8)
MainThread     INFO     2019-07-25 16:37:02,424 taurus.qt.qtgui.icon.icon: Setting Tango icon theme (from /nfs/home/cpascual/src/taurus/lib/taurus/qt/qtgui/icon/)
MainThread     INFO     2019-07-25 16:37:02,684 TaurusRootLogger: Plugin "taurus_pyqtgraph" loaded as "taurus.qt.qtgui.tpg"
TimerLoop 1    WARNING  2019-07-25 16:37:06,283 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
TimerLoop 1    WARNING  2019-07-25 16:37:10,512 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
TimerLoop 1    WARNING  2019-07-25 16:37:14,606 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
Exception in thread TimerLoop 1:
Traceback (most recent call last):
  File "/home/cpascual/miniconda/envs/py3qt5/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/cpascual/miniconda/envs/py3qt5/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/nfs/home/cpascual/src/taurus/lib/taurus/core/util/timer.py", line 91, in __run
    self.__function(*self.__args, **self.__kwargs)
  File "/nfs/home/cpascual/src/taurus/lib/taurus/core/tauruspollingtimer.py", line 136, in _pollAttributes
    for dev, attrs in self.dev_dict.items():
RuntimeError: dictionary changed size during iteration

TimerLoop 1    ERROR    2019-07-25 16:37:14,994 TaurusPollingTimer[3000]: poll_reply error
TimerLoop 1    ERROR    2019-07-25 16:37:15,018 TaurusPollingTimer[3000]: poll_reply error
TimerLoop 1    WARNING  2019-07-25 16:37:18,271 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
TimerLoop 1    ERROR    2019-07-25 16:37:18,272 TaurusPollingTimer[3000]: poll_reply error
TimerLoop 1    WARNING  2019-07-25 16:37:21,626 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
TimerLoop 1    ERROR    2019-07-25 16:37:21,627 TaurusPollingTimer[3000]: poll_reply error
TimerLoop 1    WARNING  2019-07-25 16:37:24,981 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
TimerLoop 1    WARNING  2019-07-25 16:37:28,800 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
TimerLoop 1    ERROR    2019-07-25 16:37:28,801 TaurusPollingTimer[3000]: poll_reply error
TimerLoop 1    ERROR    2019-07-25 16:37:29,011 TaurusPollingTimer[3000]: poll_reply error
TimerLoop 1    ERROR    2019-07-25 16:37:30,018 TaurusPollingTimer[3000]: poll_reply error
TimerLoop 1    WARNING  2019-07-25 16:37:33,336 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
TimerLoop 1    ERROR    2019-07-25 16:37:33,337 TaurusPollingTimer[3000]: poll_reply error
TimerLoop 1    WARNING  2019-07-25 16:37:36,716 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
TimerLoop 1    ERROR    2019-07-25 16:37:36,717 TaurusPollingTimer[3000]: poll_reply error
TimerLoop 1    WARNING  2019-07-25 16:37:40,154 TaurusPollingTimer[3000].Timer on _pollAttributes: loop function took more than loop interval (3.0s)
TimerLoop 1    ERROR    2019-07-25 16:37:45,016 TaurusPollingTimer[3000]: poll_reply error

@cpascual cpascual modified the milestones: Jul19, Jan20 Jul 25, 2019
@cpascual
Copy link
Member

I think this is a corner case and not release-critical, so moved it to Jan20 milestone

@cpascual cpascual modified the milestones: Jan20, Jul20 May 7, 2020
@cpascual cpascual modified the milestones: Jul20, Jan21 Jul 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug py3 This issu affects especifically to python3 support
Projects
None yet
Development

No branches or pull requests

2 participants