]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: improve cancellation in worker event loops
authorJay Conrod <jayconrod@google.com>
Fri, 19 Mar 2021 19:11:29 +0000 (15:11 -0400)
committerJay Conrod <jayconrod@google.com>
Fri, 9 Apr 2021 19:50:15 +0000 (19:50 +0000)
commit4cde035a720448b2bca07ecdc12beef3b1322939
tree058b2544c3b88092b3b53133163e501efe99568b
parentb178a81e1f95eea38893e6da8daa3260d3e601de
[dev.fuzz] internal/fuzz: improve cancellation in worker event loops

worker.runFuzzing now accepts a Context, used for cancellation instead
of doneC (which is removed). This is passed down through workerClient
RPC methods (ping, fuzz).

workerClient RPC methods now wrap the call method, which handles
marshaling and cancellation.

Both workerClient.call and workerServer.serve should return quickly
when their contexts are cancelled. Turns out, closing the pipe won't
actually unblock a read on all platforms. Instead, we were falling
back to SIGKILL in worker.stop, which works but takes longer than
necessary.

Also fixed missing newline in log message.

Change-Id: I7b5ae54d6eb9afd6361a07759f049f048952e0cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/303429
Trust: Jay Conrod <jayconrod@google.com>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Katie Hockman <katie@golang.org>
src/cmd/go/testdata/script/test_fuzz_io_error.txt [new file with mode: 0644]
src/internal/fuzz/fuzz.go
src/internal/fuzz/sys_windows.go
src/internal/fuzz/worker.go
src/testing/fuzz.go