Merge lp:~jelmer/brz/config-race into lp:brz/3.3

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7825
Merged at revision: 7824
Proposed branch: lp:~jelmer/brz/config-race
Merge into: lp:brz/3.3
Diff against target: 30 lines (+7/-4)
1 file modified
breezy/config.py (+7/-4)
To merge this branch: bzr merge lp:~jelmer/brz/config-race
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+462103@code.launchpad.net

Commit message

Ignore race conditions loading config

Description of the change

Ignore race conditions loading config

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Download full text (13.9 KiB)

The attempt to merge lp:~jelmer/brz/config-race into lp:brz/3.3 failed. Command exited with 1.
Below is the output from the failed tests.

Collecting setuptools-gettext
  Downloading setuptools_gettext-0.1.11-py3-none-any.whl.metadata (1.9 kB)
Requirement already satisfied: types-paramiko in /usr/lib/python3/dist-packages (3.3)
Requirement already satisfied: setuptools>=60.8 in ./lib/python3.11/site-packages (from setuptools-gettext) (68.1.2)
Requirement already satisfied: cryptography>=37.0.0 in /usr/lib/python3/dist-packages (from types-paramiko) (38.0.4)
Downloading setuptools_gettext-0.1.11-py3-none-any.whl (13 kB)
Installing collected packages: setuptools-gettext
Successfully installed setuptools-gettext-0.1.11
Obtaining file:///tmp/tarmac/branch.9btm22h9
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
  Getting requirements to build editable: started
  Getting requirements to build editable: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing editable metadata (pyproject.toml): started
  Preparing editable metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (5.0.8)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (0.2)
Requirement already satisfied: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (0.2.13)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (0.0.8)
Requirement already satisfied: dulwich>=0.21.6 in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (0.21.6)
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (1.26.18)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (6.0.1)
Collecting tzlocal (from breezy==3.3.6.dev0)
  Downloading tzlocal-5.2-py3-none-any.whl.metadata (7.8 kB)
Collecting testtools (from breezy==3.3.6.dev0)
  Downloading testtools-2.7.1-py3-none-any.whl.metadata (5.3 kB)
Collecting testscenarios (from breezy==3.3.6.dev0)
  Downloading testscenarios-0.5.0-py2.py3-none-any.whl.metadata (12 kB)
Collecting python-subunit (from breezy==3.3.6.dev0)
  Downloading python_subunit-1.4.4-py3-none-any.whl.metadata (22 kB)
Requirement already satisfied: flake8 in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (7.0.0)
Collecting cython>=0.29 (from breezy==3.3.6.dev0)
  Using cached Cython-3.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.2 kB)
Collecting docutils (from breezy==3.3.6.dev0)
  Downloading docutils-0.20.1-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: setuptools in ./lib/python3.11/site-packages (from breezy==3.3.6.dev0) (68.1.2)
Collecting sphinx (from breezy==3.3.6.dev0)
  Downloading sphinx-7.2.6-py3-none-any.whl.metadata (5.9 kB)
...

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Download full text (89.0 KiB)

The attempt to merge lp:~jelmer/brz/config-race into lp:brz/3.3 failed. Command exited with 2.
Below is the output from the failed tests.

Collecting setuptools-gettext
  Using cached setuptools_gettext-0.1.11-py3-none-any.whl.metadata (1.9 kB)
Collecting types-paramiko
  Downloading types_paramiko-3.4.0.20240311-py3-none-any.whl.metadata (1.8 kB)
Requirement already satisfied: setuptools>=60.8 in ./lib/python3.11/site-packages (from setuptools-gettext) (68.1.2)
Requirement already satisfied: cryptography>=37.0.0 in /usr/lib/python3/dist-packages (from types-paramiko) (38.0.4)
Using cached setuptools_gettext-0.1.11-py3-none-any.whl (13 kB)
Downloading types_paramiko-3.4.0.20240311-py3-none-any.whl (33 kB)
Installing collected packages: types-paramiko, setuptools-gettext
Successfully installed setuptools-gettext-0.1.11 types-paramiko-3.4.0.20240311
Obtaining file:///tmp/tarmac/branch.lj2rnzwf
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
  Getting requirements to build editable: started
  Getting requirements to build editable: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing editable metadata (pyproject.toml): started
  Preparing editable metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (5.0.8)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (0.2)
Requirement already satisfied: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (0.2.13)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (0.0.8)
Requirement already satisfied: dulwich>=0.21.6 in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (0.21.6)
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (1.26.18)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (6.0.1)
Collecting tzlocal (from breezy==3.3.6.dev0)
  Downloading tzlocal-5.2-py3-none-any.whl.metadata (7.8 kB)
Collecting testtools (from breezy==3.3.6.dev0)
  Using cached testtools-2.7.1-py3-none-any.whl.metadata (5.3 kB)
Collecting testscenarios (from breezy==3.3.6.dev0)
  Using cached testscenarios-0.5.0-py2.py3-none-any.whl.metadata (12 kB)
Collecting python-subunit (from breezy==3.3.6.dev0)
  Using cached python_subunit-1.4.4-py3-none-any.whl.metadata (22 kB)
Requirement already satisfied: flake8 in /usr/lib/python3/dist-packages (from breezy==3.3.6.dev0) (7.0.0)
Collecting cython>=0.29 (from breezy==3.3.6.dev0)
  Using cached Cython-3.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.2 kB)
Collecting docutils (from breezy==3.3.6.dev0)
  Using cached docutils-0.20.1-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: setuptools in ./lib/python3.11/site-packages (fr...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/config.py'
2--- breezy/config.py 2023-01-31 01:05:40 +0000
3+++ breezy/config.py 2024-03-16 16:02:39 +0000
4@@ -2991,19 +2991,22 @@
5 Args:
6 bytes: A string representing the file content.
7 """
8- if self.is_loaded():
9- raise AssertionError('Already loaded: {!r}'.format(self._config_obj))
10 co_input = BytesIO(bytes)
11 try:
12 # The config files are always stored utf8-encoded
13- self._config_obj = ConfigObj(co_input, encoding='utf-8',
14- list_values=False)
15+ new_config_obj = ConfigObj(co_input, encoding='utf-8', list_values=False)
16 except configobj.ConfigObjError as e:
17 self._config_obj = None
18 raise ParseConfigError(e.errors, self.external_url())
19 except UnicodeDecodeError:
20 raise ConfigContentError(self.external_url())
21
22+ if self._config_obj is not None:
23+ if new_config_obj != self._config_obj:
24+ raise AssertionError("ConfigObj instances are not equal")
25+
26+ self._config_obj = new_config_obj
27+
28 def save_changes(self):
29 if not self.is_loaded():
30 # Nothing to save

Subscribers

People subscribed via source and target branches