zrepl/rpc
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
..
dataconn rpc: fix data race in timeoutconn 2021-01-25 00:16:01 +01:00
grpcclientidentity [#307] add package trace, integrate it with logging, and adopt it throughout zrepl 2020-05-19 11:30:02 +02:00
netadaptor [#307] rpc: proper handling of context cancellation for transportmux + dataconn 2020-05-18 19:46:24 +02:00
transportmux [#307] add package trace, integrate it with logging, and adopt it throughout zrepl 2020-05-19 11:30:02 +02:00
versionhandshake replication + endpoint: replication guarantees: guarantee_{resumability,incremental,nothing} 2020-07-26 20:32:35 +02:00
rpc_client.go Reformat all files with make format. 2020-08-31 23:57:45 +02:00
rpc_debug.go run golangci-lint and apply suggested fixes 2019-03-27 13:12:26 +01:00
rpc_doc.go format source tree using goimports 2019-03-22 19:41:12 +01:00
rpc_logging.go [#307] add package trace, integrate it with logging, and adopt it throughout zrepl 2020-05-19 11:30:02 +02:00
rpc_mux.go format source tree using goimports 2019-03-22 19:41:12 +01:00
rpc_server.go [#307] add package trace, integrate it with logging, and adopt it throughout zrepl 2020-05-19 11:30:02 +02:00