[ RUN ] NetworkServiceRestartBrowserTest.FetchFromServiceWorkerControlledPage_PassThroughDevTools listening on ws://127.0.0.1:37331/devtools/browser/2789285f-1fb1-4290-acce-ae230d5b1248[231847:231847:1008/151606.045385:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 0; has_error = 0; network_context_.get() = (nil)[231847:231847:1008/151606.045756:ERROR:storage_partition_impl.cc(1343)] StoragePartitionImpl::InitNetworkContext; was_bound = 0; had_error = 0; network_context_.get() = 0x1937d93a6480[231847:231847:1008/151606.045910:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d93a6480[231847:231847:1008/151606.143935:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d93a6480[231847:231847:1008/151606.984577:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d93a6480[231847:231847:1008/151606.994738:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d93a6480[231847:231847:1008/151607.019132:ERROR:embedded_worker_instance.cc(96)] embedded_worker_instance.cc: CreateFactoryBundle ...[231847:231847:1008/151607.019199:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d93a6480[231847:231847:1008/151607.019306:ERROR:embedded_worker_instance.cc(126)] embedded_worker_instance.cc: CreateFactoryBundle ... done.[231847:231847:1008/151607.019337:ERROR:embedded_worker_instance.cc(96)] embedded_worker_instance.cc: CreateFactoryBundle ...[231847:231847:1008/151607.019381:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d93a6480[231847:231847:1008/151607.019444:ERROR:embedded_worker_instance.cc(126)] embedded_worker_instance.cc: CreateFactoryBundle ... done.[231847:231847:1008/151607.117424:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d93a6480[231847:231847:1008/151607.119528:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d93a6480[231868:231904:1008/151607.148278:ERROR:network_service_test_helper.cc(114)] Intentionally terminating current process to simulate NetworkService crash for testing.An error handler of network::mojom::NetworkServicePtr posts a task that executes RenderFrameHostImpl::UpdateSubresourceLoaderFactories:[231847:231847:1008/151607.160191:ERROR:render_frame_host_impl.cc(4874)] RenderFrameHostImpl::UpdateSubresourceLoaderFactories ...[231847:231847:1008/151607.160262:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d93a6480
Notice that on the previous line, a stale |network_context_| is used (i.e. |has_error = 0| shows that InterfacePtr::encountered_error() still returned false despite NetworkService crash).
[231847:231847:1008/151607.160514:ERROR:render_frame_host_impl.cc(4887)] RenderFrameHostImpl::UpdateSubresourceLoaderFactories ... done.[231847:231847:1008/151607.161109:ERROR:storage_partition_impl.cc(1343)] StoragePartitionImpl::InitNetworkContext; was_bound = 1; had_error = 1; network_context_.get() = 0x1937d954acd0
Only now |had_error| is true...
[231847:231847:1008/151608.152541:ERROR:embedded_worker_instance.cc(96)] embedded_worker_instance.cc: CreateFactoryBundle ...[231847:231847:1008/151608.152646:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d954acd0[231847:231847:1008/151608.152756:ERROR:embedded_worker_instance.cc(126)] embedded_worker_instance.cc: CreateFactoryBundle ... done.[231847:231847:1008/151608.152789:ERROR:embedded_worker_instance.cc(96)] embedded_worker_instance.cc: CreateFactoryBundle ...[231847:231847:1008/151608.152851:ERROR:storage_partition_impl.cc(742)] StoragePartitionImpl::GetNetworkContext; is_bound = 1; has_error = 0; network_context_.get() = 0x1937d954acd0[231847:231847:1008/151608.152928:ERROR:embedded_worker_instance.cc(126)] embedded_worker_instance.cc: CreateFactoryBundle ... done.../../content/browser/network_service_restart_browsertest.cc:776: FailureExpected equality of these values:"Echo"Which is: 0x317a9aEvalJs(shell(), script)Which is: "TypeError: Failed to fetch"
Hello,Consider the following situation:
- content::StoragePartition::network_context_ is a network::mojom::NetworkContextPtr
- The InterfacePtr is initially bound in content::StoragePartitionImpl::InitNetworkContext and an error handler is registered to call InitNetworkContext again after errors.
- network::mojom::URLLoaderFactoryPtr is bound in RenderFrameHostImpl::CreateNetworkServiceDefaultFactoryInternal, by passing network::mojom::URLLoaderFactoryRequest into CreateURLLoaderFactory method of network::mojom::NetworkContext
- Today, RenderFrameHostImpl registers an error handler (RenderFrameHostImpl::UpdateSubresourceLoaderFactories) via network::mojom::URLLoaderFactoryPtr (on a separate network::mojom::URLLoaderFactoryPtr maintained for the sole purpose of detecting mojo errors - see RenderFrameHostImpl::network_service_connection_error_handler_holder_)
- For the future, I am trying to get rid of |RenderFrameHostImpl::network_service_connection_error_handler_holder_| and instead introduce generic RegisterNetworkServiceCrashHandler(base::RepeatingClosure). See https://crrev.com/c/1263555. This generic handler registers an error handler via network::mojom::NetworkServicePtr.
Problem: when RenderFrameHostImpl::UpdateSubresourceLoaderFactories runs, the network::mojom::NetworkContextPtr might or might not yet realize that an error occurred. This means that RenderFrameHostImpl::UpdateSubresourceLoaderFactories might use a stale network::mojom::NetworkContext* (one that won't work going forward).
--
You received this message because you are subscribed to the Google Groups "network-service-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to network-service...@chromium.org.
To post to this group, send email to network-s...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/network-service-dev/CAA_NCUG-vM-kgk6eEQZg%3Dv9ZS3-EXgm%2BUcniEtrpN-o0t0B3TA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/network-service-dev/CAP0dkbiSFC4ZbTzV6OP6Cy_2Fy_g%2BpZO35J4KO-5g5KaPhWdqA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to network-service-dev+unsub...@chromium.org.
To post to this group, send email to network-service-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/network-service-dev/CAA_NCUG-vM-kgk6eEQZg%3Dv9ZS3-EXgm%2BUcniEtrpN-o0t0B3TA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "network-service-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to network-service-dev+unsub...@chromium.org.
To post to this group, send email to network-service-dev@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to network-service...@chromium.org.
To post to this group, send email to network-s...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/network-service-dev/CAA_NCUG-vM-kgk6eEQZg%3Dv9ZS3-EXgm%2BUcniEtrpN-o0t0B3TA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "network-service-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to network-service...@chromium.org.
To post to this group, send email to network-s...@chromium.org.
The method to crash the NetworkContext in the browser test fixture already waits for the NetworkService to be restarted. If AddCorbExceptionForPlugin isn't call synchronously on NetworkService restart, perhaps it should be?
To unsubscribe from this group and stop receiving emails from it, send an email to network-service-dev+unsub...@chromium.org.
To post to this group, send email to network-service-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/network-service-dev/CAA_NCUG-vM-kgk6eEQZg%3Dv9ZS3-EXgm%2BUcniEtrpN-o0t0B3TA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "network-service-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to network-service-dev+unsub...@chromium.org.
To post to this group, send email to network-service-dev@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to network-service...@chromium.org.
To post to this group, send email to network-s...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/network-service-dev/CAA_NCUG-vM-kgk6eEQZg%3Dv9ZS3-EXgm%2BUcniEtrpN-o0t0B3TA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "network-service-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to network-service...@chromium.org.
To post to this group, send email to network-s...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/network-service-dev/CAP0dkbiSFC4ZbTzV6OP6Cy_2Fy_g%2BpZO35J4KO-5g5KaPhWdqA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "network-service-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to network-service...@chromium.org.
To post to this group, send email to network-s...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/network-service-dev/CAA_NCUFPOyNNbuPY6dAx%3DhLp8-SXeP%2BNnsf2rjuTayigOzEz9w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/network-service-dev/CAJ_xCinWG15mVFXs9PERA5QLt5UD1Yj4diq9yOiZ6PwBwjcj0A%40mail.gmail.com.