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

Issue 729994 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

service worker database use leveldb, is not multi-process safe

Reported by atua...@gmail.com, Jun 6 2017

Issue description

Steps to reproduce the problem:
1. multi-process use multi android webview, and use same storage path.
2. service worker will storage its registration info to leveldb.
3. when access leveldb at the same time, it will fail with IOError, and fail to register serviceworker.

What is the expected behavior?
use sqlite to replace leavedb

What went wrong?
leavedb is not support multi-process access

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 55.0.2883.87  Channel: n/a
OS Version: 
Flash Version: Shockwave Flash 25.0 r0
 
Cc: bsittler@chromium.org
Components: Mobile>WebView
I don't know whether this is supposed to work. Adding Mobile>WebView component since this seems to be WebView-specific
Also, please fill in the following additional information specific to WebView:

Device name:
Android version:
WebView version (from system settings -> Apps -> Android System WebView):
Application:
Application version:

Comment 3 by torne@chromium.org, Jun 6 2017

Status: WontFix (was: Unconfirmed)
It's not safe to use WebView from more than one process with the same storage path at all - it's not just the service worker database, *none* of the databases are safe (even the sqlite databases - interprocess locking in sqlite is explicitly turned off for performance). Chromium does not support this in general; it's not WebView-specific, you also can't do this in regular Chrome on any OS.

WebView should warn you in the system log that this is unsupported and unsafe when you do it. We've tried to block this in the past to avoid app developers making this mistake but haven't yet managed to get this shipped (see  issue 558377  for more info).

Avoid using WebView from more than one process in your app.

Comment 4 by atua...@gmail.com, Jun 7 2017

one possible solution is support to override storage partition directory at runtime, different process use different directory. but this is related to chromium startup, many cache/database/objects are initialize at startup, and will not re-initialize when storage partition directory changed.

Comment 5 by atua...@gmail.com, Jun 7 2017

multi-process app use browser base on WebView, it will pre-create browser process in general(it must specify storage partition directory at this time), for speed up app pages startup performance. and when user visit pages on app, it will create first WebView(and it needs to override storage partition directory for specify process to avoid multi-process problem).

but we can override storage partition directory after chromium startup finish.

Comment 6 by torne@chromium.org, Jun 7 2017

We don't have any current plans to support changing the storage directory, and even if we add an API for this it wouldn't be supported on existing Android versions so you'd still have to code your app to avoid doing this on OS versions that didn't support it.

Generally we advise developers not to include general purpose browsers based on WebView in their apps at all, and instead launch the user's default browser (optionally using the Chrome Custom Tabs API to control the UX). If your app has multiple processes then it's up to you to make sure only one of them requires WebView.

Sign in to add a comment