Bug 145406 - [SOUP] Network Cache: Handle the case when we fail to create the IO stream
Summary: [SOUP] Network Cache: Handle the case when we fail to create the IO stream
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, Soup
Depends on:
Blocks:
 
Reported: 2015-05-27 01:00 PDT by Carlos Garcia Campos
Modified: 2015-05-27 01:37 PDT (History)
2 users (show)

See Also:


Attachments
Patch (4.55 KB, patch)
2015-05-27 01:04 PDT, Carlos Garcia Campos
svillar: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2015-05-27 01:00:51 PDT
We are currently asserting in that case, but it can happen that we fail to create the stream. It happened to me after r184690, that changed the NetworkCache::Key hashes. 

(process:11766): GLib-GIO-CRITICAL **: g_input_stream_read_async: assertion 'G_IS_INPUT_STREAM (stream)' failed

(process:11766): GLib-GIO-CRITICAL **: g_input_stream_read_async: assertion 'G_IS_INPUT_STREAM (stream)' failed

(process:11766): GLib-GIO-CRITICAL **: g_input_stream_read_async: assertion 'G_IS_INPUT_STREAM (stream)' failed

(process:11766): GLib-GIO-CRITICAL **: g_input_stream_read_async: assertion 'G_IS_INPUT_STREAM (stream)' failed

(process:11766): GLib-GIO-CRITICAL **: g_input_stream_read_async: assertion 'G_IS_INPUT_STREAM (stream)' failed

(process:11766): GLib-GIO-CRITICAL **: g_input_stream_read_async: assertion 'G_IS_INPUT_STREAM (stream)' failed

Since this was not expected to happen, the async operation never finished and then the completion handler never called, leaving those resources loading forever. We should make sure we call the completion handler with an error code, so that the load finishes and the entry is silently removed from the cache.
Comment 1 Carlos Garcia Campos 2015-05-27 01:04:10 PDT
Created attachment 253787 [details]
Patch
Comment 2 Carlos Garcia Campos 2015-05-27 01:37:58 PDT
Committed r184901: <http://trac.webkit.org/changeset/184901>