]> Cypherpunks repositories - gostls13.git/commit
runtime/race: fix benchmark deadlock
authorAustin Clements <austin@google.com>
Mon, 27 Apr 2015 20:31:16 +0000 (16:31 -0400)
committerAustin Clements <austin@google.com>
Mon, 27 Apr 2015 20:54:34 +0000 (20:54 +0000)
commit23ce80efebbdebd202314717ee7372d4f0f25051
tree8a82e2e8a05107bbcc6abb95ae95cf0f38143348
parent8cb9c21cce483d016b520838c828b4403c5dfc81
runtime/race: fix benchmark deadlock

Currently TestRaceCrawl fails to wg.Done for every wg.Adds if the
depth ever reaches 0. This causes the test to deadlock. Under the race
detector, this deadlock is not detected, so the test eventually times
out.

This only recently became a problem. Prior to commit e870f06 the depth
would never reach 0 because the strict round-robin goroutine schedule
ensured that all of the URLs were already "seen" by depth 2. Now that
the runtime prefers scheduling the most recently started goroutine,
the test is able to reach depth 0 and trigger this deadlock.

Change-Id: I5176302a89614a344c84d587073b364833af6590
Reviewed-on: https://go-review.googlesource.com/9344
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/race/testdata/mop_test.go