Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(135)

Issue 445002: Fix of a race condition during Crash Generation Server startup (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 2 months ago by Ivan Penkov
Modified:
12 years, 1 month ago
CC:
thakis, alexeypa, google-breakpad-dev_googlegroups.com
Base URL:
http://google-breakpad.googlecode.com/svn/trunk/src/
Visibility:
Public.

Description

The Crash Generation Server internal state ('server_state_'  member) is normally
updated and accessed from a single thread - and this is the thread running 
CrashGenerationServer::HandleConnectionRequest.

There are two exceptions of this rule and we must ensure that they are handled
correctly: 
  1. The server state is set during startup (CrashGenerationServer::Start) as
part of the initial setup. There was a small race window between requesting the
first connection and setting the initial state to 'Connecting' or 'Connected' in
which the first client can actually connect and trigger HandleConnectionRequest
in the thread pool - I'm basically removing the code which requests the first
connection from the startup routine which completely eliminates this race
window. The first connection request will now happen on the thread pool.
  2. The server state is checked during shutdown (CrashGenerationServer
destructor).  This is not a problem at all since it only checks whether the
IPC_SERVER_STATE_ERROR was reached which is a terminal state.  The first thing
done after that is to wait until all threads in the thread pool complete.  No
problems here.

This is tracked by the following bug:
http://code.google.com/p/chromium/issues/detail?id=144928

Thanks,
-Ivan

Patch Set 1 #

Patch Set 2 : Bypassing EnterErrorState in the case where SetEvent fails since it will try one more time to set t… #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M client/windows/crash_generation/crash_generation_server.cc View 1 2 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 2
Ivan Penkov
.
12 years, 2 months ago #1
Mark Mentovai
12 years, 2 months ago #2
LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted