From 878946cbba5c2ae6dc78ac8d8d4dbe0eba9a56f0 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Fri, 11 Sep 2020 09:14:30 +0200 Subject: [PATCH] Remove source_event from Change objects In the past source_event has been used to improve merge messages. This is being attached to changes in getChange. Since there can be any event on a change this has been wrong and is now unused. Thus remove this variable. Further it currently even creates a problematic memleak when doing dequeue commands without the change being in any queue. In this case the exception trace including all local variables of the frames (e.g. Tenant) are attached to the event and thus to the cached change which will never be cleared unless there is another event incoming for this change). Change-Id: I23e59e66f485bf46493d7a5bdf7bc29966e56993 --- zuul/driver/github/githubconnection.py | 2 -- zuul/driver/gitlab/gitlabconnection.py | 3 --- zuul/driver/pagure/pagureconnection.py | 3 --- zuul/model.py | 2 -- 4 files changed, 10 deletions(-) diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py index da242401ee..194ba3c1ad 100644 --- a/zuul/driver/github/githubconnection.py +++ b/zuul/driver/github/githubconnection.py @@ -1258,7 +1258,6 @@ class GithubConnection(BaseConnection): change = self._getChange(project, event.change_number, event.patch_number, refresh=refresh, event=event) - change.source_event = event change.is_current_patchset = (change.pr.get('head').get('sha') == event.patch_number) else: @@ -1278,7 +1277,6 @@ class GithubConnection(BaseConnection): # In case we have a tag, we build the url pointing to this # tag/release on GitHub. change.url = self.getGitwebUrl(project, sha=event.newrev, tag=tag) - change.source_event = event if hasattr(event, 'commits'): change.files = self.getPushedFileNames(event) return change diff --git a/zuul/driver/gitlab/gitlabconnection.py b/zuul/driver/gitlab/gitlabconnection.py index 2798d84eea..63bc84504a 100644 --- a/zuul/driver/gitlab/gitlabconnection.py +++ b/zuul/driver/gitlab/gitlabconnection.py @@ -461,7 +461,6 @@ class GitlabConnection(BaseConnection): change = self._getChange( project, event.change_number, event.patch_number, refresh=refresh, event=event) - change.source_event = event change.is_current_patchset = (change.patchset == event.patch_number) else: @@ -483,8 +482,6 @@ class GitlabConnection(BaseConnection): change.url = self.getGitwebUrl(project, sha=event.newrev) change.files = None - - change.source_event = event return change def _getChange(self, project, number, patch_number=None, diff --git a/zuul/driver/pagure/pagureconnection.py b/zuul/driver/pagure/pagureconnection.py index 4e30768adf..3f44420b9c 100644 --- a/zuul/driver/pagure/pagureconnection.py +++ b/zuul/driver/pagure/pagureconnection.py @@ -658,7 +658,6 @@ class PagureConnection(BaseConnection): change = self._getChange( project, event.change_number, event.patch_number, refresh=refresh, event=event) - change.source_event = event change.is_current_patchset = (change.pr.get('commit_stop') == event.patch_number) else: @@ -684,8 +683,6 @@ class PagureConnection(BaseConnection): # call the merger asynchronuously change.files = None - change.source_event = event - return change def _getChange(self, project, number, patchset=None, diff --git a/zuul/model.py b/zuul/model.py index cf0191730c..d44d920e5d 100644 --- a/zuul/model.py +++ b/zuul/model.py @@ -3211,8 +3211,6 @@ class Change(Branch): # look for depends-on headers. self.message = None - self.source_event = None - def _id(self): return '%s,%s' % (self.number, self.patchset)