Bug 183042

Summary: Add release logging for CacheStorage::Engine disk related functions
Product: WebKit Reporter: youenn fablet <youennf>
Component: Service WorkersAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description youenn fablet 2018-02-22 09:25:46 PST
Add release logging for CacheStorage::Engine disk related functions
Comment 1 youenn fablet 2018-02-22 09:26:48 PST
Created attachment 334456 [details]
Patch
Comment 2 Chris Dumez 2018-02-22 09:28:42 PST
Comment on attachment 334456 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=334456&action=review

> Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:285
> +                RELEASE_LOG_ERROR(CacheStorage, "CacheStorage::Engine::writeFile failed with error %d", error);

An engine has an associated sessionID. You should check that the sessionID is not one for an ephemeral session before logging.
Comment 3 youenn fablet 2018-02-22 09:36:41 PST
(In reply to Chris Dumez from comment #2)
> Comment on attachment 334456 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=334456&action=review
> 
> > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:285
> > +                RELEASE_LOG_ERROR(CacheStorage, "CacheStorage::Engine::writeFile failed with error %d", error);
> 
> An engine has an associated sessionID. You should check that the sessionID
> is not one for an ephemeral session before logging.

This is unnecessary as CacheStorage::Engine should not write any file for ephemeral sessions.
We could add something like ASSERT(!sessionID.isEphemeral()) at the beginning of writeDisk/readDisk though.
Comment 4 Chris Dumez 2018-02-22 09:37:43 PST
(In reply to youenn fablet from comment #3)
> (In reply to Chris Dumez from comment #2)
> > Comment on attachment 334456 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=334456&action=review
> > 
> > > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:285
> > > +                RELEASE_LOG_ERROR(CacheStorage, "CacheStorage::Engine::writeFile failed with error %d", error);
> > 
> > An engine has an associated sessionID. You should check that the sessionID
> > is not one for an ephemeral session before logging.
> 
> This is unnecessary as CacheStorage::Engine should not write any file for
> ephemeral sessions.
> We could add something like ASSERT(!sessionID.isEphemeral()) at the
> beginning of writeDisk/readDisk though.

Ok, please do that.
Comment 5 Chris Dumez 2018-02-22 09:38:14 PST
Comment on attachment 334456 [details]
Patch

r=me with the added assertions.
Comment 6 youenn fablet 2018-02-22 09:40:39 PST
(In reply to youenn fablet from comment #3)
> (In reply to Chris Dumez from comment #2)
> > Comment on attachment 334456 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=334456&action=review
> > 
> > > Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:285
> > > +                RELEASE_LOG_ERROR(CacheStorage, "CacheStorage::Engine::writeFile failed with error %d", error);
> > 
> > An engine has an associated sessionID. You should check that the sessionID
> > is not one for an ephemeral session before logging.
> 
> This is unnecessary as CacheStorage::Engine should not write any file for
> ephemeral sessions.
> We could add something like ASSERT(!sessionID.isEphemeral()) at the
> beginning of writeDisk/readDisk though.

Actually, Engine does not store any sessionID.
In case of ephemeral session, m_rootPath is null and we are checking whether it is null at the beginning of read/write methods.
Comment 7 youenn fablet 2018-02-22 10:32:25 PST
Chris, I'll land the patch as is given the persistency check is close to the release logging and given the fact engine is not storing its sessionID.
Let me know if that does not work for you.
Comment 8 WebKit Commit Bot 2018-02-22 10:36:24 PST
Comment on attachment 334456 [details]
Patch

Rejecting attachment 334456 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 334456, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
rdparty/autoinstalled/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1170, in https_open
    return self.do_open(conn_factory, req)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1118, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 60] Operation timed out>

Full output: http://webkit-queues.webkit.org/results/6624429
Comment 9 WebKit Commit Bot 2018-02-22 10:51:58 PST
Comment on attachment 334456 [details]
Patch

Clearing flags on attachment: 334456

Committed r228925: <https://trac.webkit.org/changeset/228925>
Comment 10 WebKit Commit Bot 2018-02-22 10:51:59 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Radar WebKit Bug Importer 2018-02-22 10:53:11 PST
<rdar://problem/37793473>