New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 702830 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature



Sign in to add a comment

Service manifests silently ignore duplicate keys

Project Member Reported by liber...@chromium.org, Mar 17 2017

Issue description

i added an "gpu" entry to content_browser_manifest.json for a new service that was to be the first one provided to the gpu process.  separately, somebody else added a "gpu" entry with their own service, elsewhere in the file.

so, now we have:
...
"gpu" : [ their new service ],
"renderer" : [ lots of services ],
"gpu" : [ my new service ]

the result is that my entry overrode theirs, causing mojo to get angry that their service wasn't exported to the gpu process in the manifest when it tried to connect.  didn't cause a patch failure, since the changes weren't nearby.  luckily, there were tests else it would have gone unnoticed.

maybe it should be illegal to specify the same client more than once in a manifest.  mojo could get mad about it when parsing the manifest.

it's not exactly a likely situation.  so, maybe not worth the effort.  i mention it for completeness.
 
Cc: -roc...@chromium.org rockot@google.com
Components: -Internals>Mojo Internals>Services>ServiceManager
Labels: -Pri-3 Pri-2
Status: Available (was: Untriaged)
Summary: Service manifests silently ignore duplicate keys (was: mojo manifest might need stronger validation)
This turns out to be an issue with Python's JSON parser. It gleefully ignores duplicate keys, so

  {foo: 1, foo: 2}

parses out as

  {foo: 2}

We can fix this through some arcane hooks in the API.

Triaging with medium priority, fixing component. It's not urgent, but it's also fairly low-hanging fruit with a straightforward fix.
Cc: ben@chromium.org
 Issue 706342  has been merged into this issue.

Sign in to add a comment