zuul/zuul/driver/gitlab
Tobias Henkel e9120bab27
Protect getCachedChanges from concurrent modification
We observe a few exceptions in our system while iterating over
getCachedChanges [1]. This is caused by multithreaded appending new
changes to the change cache. In order to prevent this exception we
need to make lists from the values which are safe to iterate even if
the backing dict gets updated. While we're at it fix it for all other
drivers as well.

[1] Trace:
2020-03-06 12:39:51,429 ERROR zuul.GerritEventConnector: Exception moving Gerrit event:
Traceback (most recent call last):
  File "/opt/zuul/lib/python3.6/site-packages/zuul/driver/gerrit/gerritconnection.py", line 284, in run
    self._handleEvent()
  File "/opt/zuul/lib/python3.6/site-packages/zuul/driver/gerrit/gerritconnection.py", line 243, in _handleEvent
    self._getChange(event)
  File "/opt/zuul/lib/python3.6/site-packages/zuul/driver/gerrit/gerritconnection.py", line 277, in _getChange
    refresh=True, event=event)
  File "/opt/zuul/lib/python3.6/site-packages/zuul/driver/gerrit/gerritconnection.py", line 742, in _getChange
    self._updateChange(change, event, history)
  File "/opt/zuul/lib/python3.6/site-packages/zuul/driver/gerrit/gerritconnection.py", line 820, in _updateChange
    self.sched.onChangeUpdated(change, event)
  File "/opt/zuul/lib/python3.6/site-packages/zuul/scheduler.py", line 1703, in onChangeUpdated
    for other_change in source.getCachedChanges():
RuntimeError: dictionary changed size during iteration

Change-Id: I30396997441c7e7756bfb81be708389d6331bf19
2020-03-26 18:53:32 +01:00
..
__init__.py Gitlab - bootstrap the driver structure + Webhook support 2020-02-12 21:09:58 +00:00
gitlabconnection.py Gitlab - Implement the note event and the comment trigger action 2020-02-12 22:33:10 +00:00
gitlabmodel.py Gitlab - Implement the note event and the comment trigger action 2020-02-12 22:33:10 +00:00
gitlabreporter.py Gitlab - Minimal reporter ables to comment on MR 2020-02-12 22:33:03 +00:00
gitlabsource.py Protect getCachedChanges from concurrent modification 2020-03-26 18:53:32 +01:00
gitlabtrigger.py Gitlab - Implement the note event and the comment trigger action 2020-02-12 22:33:10 +00:00