Closed
Bug 729159
Opened 12 years ago
Closed 12 years ago
services.config.get_section broken for section names with '.'
Categories
(Cloud Services :: Server: Core, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: petef, Assigned: rmiller)
References
Details
(Whiteboard: [qa-])
Attachments
(1 file)
742 bytes,
patch
|
telliott
:
review+
Atoll
:
feedback-
|
Details | Diff | Splinter Review |
In production, we have a sync config like: [storage] sqluri = foo hosts = stage-sync1.services.mozilla.com stage-sync2.services.mozilla.com [...] [host:stage-sync1.services.mozilla.com] storage.sqluri = bar and when we pass in a Host: header of stage-sync1.services.mozilla.com, we're supposed to get a storage.sqluri of "bar" in the code, but due to a bug, it's always returning "foo". I tracked this down to services.config.get_section. skey = skey.split(self.splitchar) if skey[0] != section: continue In the raw config object (as we iterate through self.items), there is a key 'host:stage-sync1.services.mozilla.com.storage.sqluri'. When get_section('host:stage-sync1.services.mozilla.com') is called, this code gets run and skips all the keys because skey[0] (in this case, 'host:stage-sync1' since it's split on '.') does not equal section ('host:stage-sync1.services.mozilla.com'). We skip these keys, so no config values ever get merged. I think it may have broken around this commit: http://hg.mozilla.org/services/server-core/diff/af86645e1cd7/services/config.py note: this is not broken in production, but broken on newer server-core and preventing loadtest work.
Reporter | ||
Comment 1•12 years ago
|
||
:rmiller, the test RPMs you gave me are working well in stage and seem to have this bug fixed. thanks!
Assignee: nobody → rmiller
Assignee | ||
Comment 2•12 years ago
|
||
Awesome! Change is currently only on the metrics.logging branch, but the changeset that fixed the issue is here: https://hg.mozilla.org/services/server-core/rev/5203f2a8b0e2
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #599370 -
Flags: review?(telliott)
Assignee | ||
Comment 4•12 years ago
|
||
reopening to push this through formal code review
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•12 years ago
|
Attachment #599370 -
Flags: review?(telliott) → review+
Assignee | ||
Comment 5•12 years ago
|
||
merged to default in https://hg.mozilla.org/services/server-core/rev/5e3e5aac4113
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Comment on attachment 599370 [details] [diff] [review] don't assume section name doesn't contain splitchar this code was rewritten without unit tests, which broke stage, and then was fixed without unit tests. f-, no tests.
Attachment #599370 -
Flags: feedback-
Updated•12 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•