zuul/zuul/driver
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
..
auth JWT drivers: Deprecate RS256withJWKS, introduce OpenIDConnect 2020-02-11 09:30:15 +00:00
bubblewrap Stop bind mounting zuul dir into bwrap 2019-06-22 18:36:21 -04:00
gerrit Protect getCachedChanges from concurrent modification 2020-03-26 18:53:32 +01:00
git Adjust io-level logging in gerrit/git drivers 2020-02-13 13:25:44 -08:00
github Protect getCachedChanges from concurrent modification 2020-03-26 18:53:32 +01:00
gitlab Protect getCachedChanges from concurrent modification 2020-03-26 18:53:32 +01:00
mqtt Report buildset result in MQTT reporter 2020-01-16 13:25:47 +01:00
nullwrap Log cpu times of ansible executions 2018-07-14 10:32:06 +02:00
pagure Protect getCachedChanges from concurrent modification 2020-03-26 18:53:32 +01:00
smtp Include ref info in smtp reporter subjects 2019-08-19 12:32:40 -07:00
sql Store build.error_detail in SQL 2020-02-26 15:11:02 -08:00
timer Disable misfire grace time of apscheduler job 2020-02-20 07:22:30 +01:00
zuul Record and report time for trigger events 2019-07-18 06:56:23 +02:00
__init__.py web: add tenant and project scoped, JWT-protected actions 2019-07-10 12:11:14 +02:00
util.py Add driver-specific pipeline requirements 2017-05-19 13:24:00 -07:00