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

Issue 6711043: code review 6711043: present: fix another race condition (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 6 months ago by dvyukov
Modified:
11 years, 5 months ago
Reviewers:
adg
CC:
golang-dev
Visibility:
Public.

Description

present: fix another race condition Several bad things are posible. 1. Since c.run() is executed in a separate goroutine, c.kill() can find c.cmd==nil. If so, it won't kill the process, but will wait for it's completion. Deadlock. 2. c.kill() can "kill" already completed "go build" process, but then wait for completion of the compiled binary. Deadlock once again. With this change it's impossible to kill "go build" process, but it must not hang, right?

Patch Set 1 #

Patch Set 2 : diff -r a36292b60407 https://dvyukov%40google.com@code.google.com/p/go.talks/ #

Patch Set 3 : diff -r a36292b60407 https://dvyukov%40google.com@code.google.com/p/go.talks/ #

Patch Set 4 : diff -r a36292b60407 https://dvyukov%40google.com@code.google.com/p/go.talks/ #

Patch Set 5 : diff -r a36292b60407 https://dvyukov%40google.com@code.google.com/p/go.talks/ #

Patch Set 6 : diff -r a36292b60407 https://dvyukov%40google.com@code.google.com/p/go.talks/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -7 lines) Patch
M present/socket.go View 1 2 3 5 chunks +14 lines, -7 lines 0 comments Download

Messages

Total messages: 2
dvyukov
Hello adg@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go.talks/
11 years, 6 months ago (2012-10-16 06:54:37 UTC) #1
adg
11 years, 6 months ago (2012-10-16 22:10:54 UTC) #2
Thanks for the fix, but I don't really like threading the inited channel through
those functions. I've restructured the code a little here:

https://codereview.appspot.com/6719050

I'd love it if you would run your manual race detector over it ;)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b