Repo Added
|
Files
61
|
Badge
README BADGES
|
circleci
fix: make blobs safely unpicklable When we attempted to turn on redis caching in production today an interesting new issue came up where we got tracebacks such as: ``` Traceback (most recent call last): File "flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "connexion/decorators/decorator.py", line 68, in wrapper response = function(request) File "connexion/decorators/uri_parsing.py", line 149, in wrapper response = function(request) File "connexion/decorators/validation.py", line 399, in wrapper return function(request) File "connexion/decorators/produces.py", line 41, in wrapper response = function(request) File "connexion/decorators/parameter.py", line 120, in wrapper return function(**kwargs) File "auslib/web/public/helpers.py", line 17, in wrapper return f(*args, transaction=transaction, **kwargs) File "auslib/web/public/client.py", line 155, in get_update_blob release, update_type, eval_metadata = AUS.evaluateRules(query, transaction=transaction) File "auslib/AUS.py", line 152, in evaluateRules candidate = blob.shouldServeUpdate(updateQuery) File "auslib/blobs/apprelease.py", line 222, in shouldServeUpdate self.log.debug("Matching rule has no application version, will not serve update.") AttributeError: 'ReleaseBlobV1' object has no attribute 'log' ``` The `log` attribute on blobs is set as a class attribute during `__init__` (https://github.com/mozilla-releng/balrog/blob/9c916ab46/src/auslib/blobs/base.py#L156). According to the comment above that, and confirmed with some digging, this was done because at some earlier point in time we required these objects to be picklable due to the `deepcopy` that happens when caching in the admin app (see https://github.com/mozilla-releng/balrog/pull/46... (continued)
2167 of 2544 branches covered (85.18%)
Branch coverage included in aggregate %.
5 of 5 new or added lines in 1 file covered. (100.0%)
5722 of 6218 relevant lines covered (92.02%)
0.92 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|