Skip to content

Commit

Permalink
chrome: Ignore errors of rpcc.Conn.Close.
Browse files Browse the repository at this point in the history
rpcc.Conn invokes Target.DetachFromTarget before closing the connection,
which fails if the target is already closed. This error is not a real
problem, but it can confuse cautious callers who check errors of Close.

See also an upstream bug:
mafredri/cdp#110

BUG=chromium:1020484
TEST=tast run betty ui.ChromeSanity

Change-Id: I0fb1e50a683e493195874344c07f66a8ecefd40e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tast-tests/+/1903152
Tested-by: Shuhei Takahashi <nya@chromium.org>
Commit-Queue: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
(cherry picked from commit 38ffaee)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tast-tests/+/1914886
Reviewed-by: Shuhei Takahashi <nya@chromium.org>
  • Loading branch information
nya3jp authored and Commit Bot committed Nov 14, 2019
1 parent 0e4511c commit 3a4a84a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/chromiumos/tast/local/chrome/cdputil/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ func (s *Session) NewConn(ctx context.Context, id target.ID) (conn *Conn, retErr

// Close releases the resources associated with the connection.
func (c *Conn) Close() error {
return c.co.Close()
// TODO(crbug.com/1020484): Return the error from rpcc.Conn.Close.
// rpcc.Conn invokes Target.DetachFromTarget before closing the connection,
// which fails if the target is already closed. This error is not a real
// problem, but it can confuse cautious callers who check errors of Close.
// See also an upstream bug: https://github.com/mafredri/cdp/issues/110
c.co.Close()
return nil
}

// ConsoleAPICalled creates a client for ConsoleAPICalled events.
Expand Down

0 comments on commit 3a4a84a

Please sign in to comment.