FXIhub / hummingbird

Monitoring and Analysing flash X-ray imaging experiments
http://fxihub.github.io/hummingbird
BSD 2-Clause "Simplified" License
16 stars 14 forks source link

Problem restarting frontend with saved buffers. #66

Closed FilipeMaia closed 8 years ago

FilipeMaia commented 8 years ago

After restarting the frontend with saved buffers sometimes the following happens


Traceback (most recent call last):
  File "/reg/neh/operator/amoopr/amo87215/hummingbird/src/interface/data_source.py", line 167, in _get_broadcast
    self._process_broadcast(data)
  File "/reg/neh/operator/amoopr/amo87215/hummingbird/src/interface/data_source.py", line 188, in _process_broadcast
    self._plotdata[title].append(data, data_x, '')
  File "/reg/neh/operator/amoopr/amo87215/hummingbird/src/interface/plotdata.py", line 36, in append
    self._l.append(l)
  File "/reg/neh/operator/amoopr/amo87215/hummingbird/src/interface/ringbuffer.py", line 34, in append
    self._data[self._index + self._maxlen] = x
IndexError: list assignment index out of range
cnettel commented 8 years ago

Looking at this based on a theory of a race condition, but it's confusing how that could happen given the Qt signalling mode. Might the closeEvent (saving the plot state) actually be called within a UNIX signal handler? The pickled maxlen, length, index, and data might then be incompatible with each other.

cnettel commented 8 years ago

Bingo. src/interface/__init__.py signal handler calls closeEvent directly. Working on a fix.