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

Issue 600021 link

Starred by 2 users

Issue metadata

Status: Fixed
Merged: issue 514474
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

TestWebServer hung on shutdown on KTU84P

Project Member Reported by boliu@chromium.org, Apr 1 2016

Issue description

Ran into this while looking into crbug.com/599192, ie running testDeleteOriginWithAppCache in a loop.

Client thread is stuck in getInputStream, and server thread is stuck in receiveRequestHeader, afaict from the shutdown request connection. Both are java standard library methods. mSsl is false.

I don't see any bugs in TestWebServer though, so maybe this is just a bug in android network stack..?

Attached traces.txt. Client thread is "Instr: org.chromium.android_webview.test.AwInstrumentationTestRunner" and server thread is "ServerThread"
 
traces.txt
34.8 KB View Download

Comment 1 by boliu@chromium.org, Apr 1 2016

Both threads are eventually stuck in recvfrom in libc.so. I don't see any api to flush the output on the client side, and afaict no such operation should be needed

Comment 2 by boliu@chromium.org, Apr 1 2016

Why even have a shutdown request? Just synchronize the shutdown signal with like an instance var, and drop any pending requests during shutdown?

The shutdown request thing probably came from the test server in android CTS where this was originally forke from.

Comment 3 by hush@chromium.org, Apr 1 2016

I think this is a duplicate of https://bugs.chromium.org/p/chromium/issues/detail?id=514474

Comment 4 by hush@chromium.org, Apr 1 2016

This is already fixed by https://android-review.googlesource.com/#/c/208685

We're just waiting for Android CTS team to release a new L-Mr1 cts package.

Comment 5 by hush@chromium.org, Apr 1 2016

Mergedinto: 514474
Status: Duplicate (was: Untriaged)

Comment 6 by hush@chromium.org, Apr 1 2016

oh.. we probably want to do the same change to the copy of TestWebServer in Chromium. Sorry I thought that test was a CTS

Comment 7 by boliu@chromium.org, Apr 1 2016

You sure? This one is not ssl

Comment 8 by boliu@chromium.org, Apr 1 2016

> Why even have a shutdown request?

Oh, that request also wakes up the thread from mSocket.accept. Meh..

Comment 9 by boliu@chromium.org, Apr 1 2016

Status: Untriaged (was: Duplicate)
Undup since this is a different test server. Does seem to be a similar issue though. Oh wonderful world of android
Components: -Internals>Network Mobile>WebView
Adding Mobile>WebView component to match similar  issue 514474 .

Removing Internals>Network as it sounds like this is an Android-specific test that lives above the net stack.

Comment 11 by boliu@chromium.org, Apr 11 2016

So.. network team wants to use the test server, but not maintain it? :p

Comment 12 by hush@chromium.org, Apr 14 2016

Owner: boliu@chromium.org
Status: Assigned (was: Untriaged)
assigning to Bo since he is already working on it
Project Member

Comment 13 by bugdroid1@chromium.org, Apr 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0b612120ae81e866ff66061ff9fee9d2cae87645

commit 0b612120ae81e866ff66061ff9fee9d2cae87645
Author: boliu <boliu@chromium.org>
Date: Fri Apr 15 00:59:45 2016

net: Rewrite TestWebServer shutdown to avoid deadlock

Android's URLConnection implementation can cause a deadlock in shutdown.
See bug for details.

Rewrite shutdown by just dropping existing requests on the server, and
join the thread. The server thread can be blocked on either the server
socket or the request socket. Need to ensure that both are closed
without races for shutdown to avoid deadlocks.

BUG= 600021 

Review URL: https://codereview.chromium.org/1855653002

Cr-Commit-Position: refs/heads/master@{#387501}

[modify] https://crrev.com/0b612120ae81e866ff66061ff9fee9d2cae87645/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java

Comment 14 by boliu@chromium.org, Apr 15 2016

Status: Fixed (was: Assigned)

Sign in to add a comment