Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Issue 50007: Better handling of startup and shutdown of the debugger agent (Closed)

Created:
11 years, 9 months ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
Reviewers:
Erik Corry
CC:
v8-dev
Visibility:
Public.

Description

Better handling of startup and shutdown of the debugger agent. During bind and listen socket errors are now handled. If the listen socket is occoupied the agent will retry its bind operation until success or shutdown. Added orderly shutdown of the debugger agent both with and without a client connected. Committed: http://code.google.com/p/v8/source/detail?r=1552

Patch Set 1 #

Total comments: 8

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -33 lines) Patch
M src/debug.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/debug.cc View 1 chunk +10 lines, -0 lines 0 comments Download
M src/debug-agent.h View 4 chunks +8 lines, -4 lines 0 comments Download
M src/debug-agent.cc View 1 5 chunks +62 lines, -17 lines 0 comments Download
M test/cctest/test-debug.cc View 1 1 chunk +41 lines, -0 lines 0 comments Download
M test/cctest/test-sockets.cc View 8 chunks +21 lines, -12 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Thygesen Gjesse
11 years, 9 months ago (2009-03-19 12:33:06 UTC) #1
Erik Corry
LGTM http://codereview.chromium.org/50007/diff/1/5 File src/debug-agent.cc (right): http://codereview.chromium.org/50007/diff/1/5#newcode52 Line 52: // If an error occoured wait a ...
11 years, 9 months ago (2009-03-19 13:17:13 UTC) #2
Søren Thygesen Gjesse
11 years, 9 months ago (2009-03-19 21:05:48 UTC) #3
http://codereview.chromium.org/50007/diff/1/5
File src/debug-agent.cc (right):

http://codereview.chromium.org/50007/diff/1/5#newcode52
Line 52: // If an error occoured wait a bit before retrying.
On 2009/03/19 13:17:13, Erik Corry wrote:
> More comments?

Done.

http://codereview.chromium.org/50007/diff/1/5#newcode73
Line 73: terminate_now_->Wait(kOneSecondInMicros);
On 2009/03/19 13:17:13, Erik Corry wrote:
> I think unless we have a concrete situation where we know it's good to wait
then
> we should probably not have a sleep here.

Agree, removed the sleep.

http://codereview.chromium.org/50007/diff/1/5#newcode79
Line 79: void DebuggerAgent::Shutdown() {
On 2009/03/19 13:17:13, Erik Corry wrote:
> Is it possible to assert we have the lock here?

We don't need the lock here as we are not looking as session_. CloseSession will
take the lock when terminating the session.

Added a Join() after server_->Shutdown() to make sure that the listener thread
is fully terminated before moving on. Otherwise we could get a new session
created just after CloseSession().

http://codereview.chromium.org/50007/diff/1/2
File test/cctest/test-debug.cc (right):

http://codereview.chromium.org/50007/diff/1/2#newcode3829
Line 3829: const int port = 5858;
On 2009/03/19 13:17:13, Erik Corry wrote:
> You already used port 5858 in this file.  In the interest of being able to
> parallelize the tests reliably you should use a different number.

Good point. Used different ports for different tests, and added a comment in the
tests about this.

Powered by Google App Engine
This is Rietveld 408576698