← Back to team overview

ubuntukylin-members team mailing list archive

[Bug 1201436] Re: Intermittent hang in ClientPidTestFixture.authorizer_may_prevent_connection_of_clients test

 

Problem analysis for new issue:

When a client connection is rejected by the server, the connection is
closed. Depending on the timing, the client will detect the connection
break either while sending the request to the server, or when it is
trying to read back the response.

In the first case, an exception is thrown while calling the
server.connect() method, and an error connection is returned to the
client (see mir_default_connect() in mir_client_library.cpp). The client
can then successfully call mir_connection_release() on the error
connection.

In the second case, an exception is thrown while trying to read back the
server response, causing the client stack to force completion of pending
RPC calls (the connect() call). The client ends up with an invalid
connection object, but not an error connection object. Calling
mir_connection_release() on this object blocks, because, although an
exception is thrown by the server.disconnect() method, the
disconnect_wait_handle is not updated. This happens because in
MirSocketRpcChannel::notify_disconnected() the pending RPC calls are not
forced to complete, since the channel has already been marked as
'disconnected' by the previous connect failure.

This bug is an instance of calling a function that talks to the server
after a connection break has been detected in a previous call. Note that
if the break is first detected while calling the funcion, then the call
doesn't block, since this is the first time we call
MirSocketRpcChannel::notify_disconnected() and the pending RPC calls are
forced to complete.

See
https://code.launchpad.net/~afrantzis/mir/fix-1201436-more/+merge/191784
for a suggested solution.

** Changed in: mir
       Status: Triaged => In Progress

** Branch linked: lp:~afrantzis/mir/fix-1201436-more

-- 
You received this bug notification because you are a member of
UbuntuKylin Members, which is subscribed to a duplicate bug report
(1220493).
https://bugs.launchpad.net/bugs/1201436

Title:
  Intermittent hang in
  ClientPidTestFixture.authorizer_may_prevent_connection_of_clients test

Status in Mir:
  In Progress

Bug description:
  I noticed some Intermittent hangs in the
  ClientPidTestFixture.authorizer_may_prevent_connection_of_clients
  tests. They are present on both Android and the desktop, although they
  are much more easily reproducible on an Android device. Run each test
  with --gtest_repeat=N to catch this (and even then may need multiple
  runs).

To manage notifications about this bug go to:
https://bugs.launchpad.net/mir/+bug/1201436/+subscriptions