zrepl/rpc/dataconn
Mathias Fredriksson d118bcc717 rpc: fix data race in timeoutconn
- `timeoutconn` handles state, yet calls to Read/Write make a copy of
  that state (non-pointer receiver) so any outbound calls will not have
  the state updated

- Even without the copy issue, the renew methods can in edge cases set a
  new deadline _after_ DisableTimeouts have been called, consider the
  following racy behavior:
    1. `renewReadDeadline` is called, checks `renewDeadlinesDisabled`
       (not disabled)
    2. `DisableTimeouts` is called, sets `renewDeadlinesDisabled`
    3. `DisableTimeouts` invokes `c.SetDeadline`
    4. `renewReadDeadline` invokes `c.SetReadDeadline`

To fix the above, the `Conn` receiver was made to be a pointer
everywhere and access to renewDeadlinesDisabled is now guarded
by an RWMutex instead of using atomics.

closes #415
2021-01-25 00:16:01 +01:00
..
base2bufpool build: drop go Dep, switch to modules, support Go 1.13 2019-09-14 13:36:44 +02:00
frameconn rpc: fix data race in timeoutconn 2021-01-25 00:16:01 +01:00
heartbeatconn rpc/dataconn: fix I/O timeout on variable receive rate 2019-03-31 14:20:06 +02:00
microbenchmark [#307] add package trace, integrate it with logging, and adopt it throughout zrepl 2020-05-19 11:30:02 +02:00
stream rpc: fix read mutex unlock in dataconn stream 2021-01-25 00:16:01 +01:00
timeoutconn rpc: fix data race in timeoutconn 2021-01-25 00:16:01 +01:00
dataconn_client.go rpc/dataconn: fix go1.15-discovered recursive Error() method impl 2020-08-12 21:41:31 +02:00
dataconn_debug.go run golangci-lint and apply suggested fixes 2019-03-27 13:12:26 +01:00
dataconn_server.go [#348] fix crash on early-recv error 2020-07-26 20:32:35 +02:00
dataconn_shared.go [#277] rpc + zfs: drop zfs.StreamCopier, use io.ReadCloser instead 2020-05-18 19:46:24 +02:00
dataconn_test.go rpc rewrite: control RPCs using gRPC + separate RPC for data transfer 2019-03-13 13:53:48 +01:00