minio/internal
Klaus Post 8e68ff9321
Add extra disconnect safety (#19022)
Fix reported races that are actually synchronized by network calls.

But this should add some extra safety for untimely disconnects.

Race reported:

```
WARNING: DATA RACE
Read at 0x00c00171c9c0 by goroutine 214:
  github.com/minio/minio/internal/grid.(*muxClient).addResponse()
      e:/gopath/src/github.com/minio/minio/internal/grid/muxclient.go:519 +0x111
  github.com/minio/minio/internal/grid.(*muxClient).error()
      e:/gopath/src/github.com/minio/minio/internal/grid/muxclient.go:470 +0x21d
  github.com/minio/minio/internal/grid.(*Connection).handleDisconnectClientMux()
      e:/gopath/src/github.com/minio/minio/internal/grid/connection.go:1391 +0x15b
  github.com/minio/minio/internal/grid.(*Connection).handleMsg()
      e:/gopath/src/github.com/minio/minio/internal/grid/connection.go:1190 +0x1ab
  github.com/minio/minio/internal/grid.(*Connection).handleMessages.func1()
      e:/gopath/src/github.com/minio/minio/internal/grid/connection.go:981 +0x610

Previous write at 0x00c00171c9c0 by goroutine 1081:
  github.com/minio/minio/internal/grid.(*muxClient).roundtrip()
      e:/gopath/src/github.com/minio/minio/internal/grid/muxclient.go:94 +0x324
  github.com/minio/minio/internal/grid.(*muxClient).traceRoundtrip()
      e:/gopath/src/github.com/minio/minio/internal/grid/trace.go:74 +0x10e4
  github.com/minio/minio/internal/grid.(*Subroute).Request()
      e:/gopath/src/github.com/minio/minio/internal/grid/connection.go:366 +0x230
  github.com/minio/minio/internal/grid.(*SingleHandler[go.shape.*github.com/minio/minio/cmd.DiskInfoOptions,go.shape.*github.com/minio/minio/cmd.DiskInfo]).Call()
      e:/gopath/src/github.com/minio/minio/internal/grid/handlers.go:554 +0x3fd
  github.com/minio/minio/cmd.(*storageRESTClient).DiskInfo()
      e:/gopath/src/github.com/minio/minio/cmd/storage-rest-client.go:314 +0x270
  github.com/minio/minio/cmd.erasureObjects.getOnlineDisksWithHealingAndInfo.func1()
      e:/gopath/src/github.com/minio/minio/cmd/erasure.go:293 +0x171
```

This read will always happen after the write, since there is a network call in between.

However a disconnect could come in while we are setting up the call, so we protect against that with extra checks.
2024-02-09 08:43:38 -08:00
..
amztime add codespell action (#18818) 2024-01-17 23:03:17 -08:00
arn Allow OpenID ARN resource ID to start with a `-` (#18255) 2023-10-16 13:50:51 -07:00
auth Add "name" and "description" params to service acc (#17172) 2023-05-17 17:05:36 -07:00
bpool Add cgroup v2 support for memory limit (#18905) 2024-01-30 11:13:27 -08:00
bucket Enable expired-object-all-versions (#18954) 2024-02-06 13:36:22 -08:00
color log: Do not interpret verbs in object names in console output (#16233) 2022-12-13 08:27:40 -08:00
config deprecate disk tokens, instead rely on deadlines and active monitoring (#18947) 2024-02-02 10:10:54 -08:00
crypto log: Use error log type instead of Application/MinIO type (#18930) 2024-02-01 16:13:57 -08:00
deadlineconn add deadlineConnections on remoteTransport (#16010) 2022-11-05 11:09:21 -07:00
disk fix: linter errors in Windows specific code (#18276) 2023-10-18 11:08:15 -07:00
dsync avoid close 'nil' panics if any (#18890) 2024-01-28 10:04:17 -08:00
etag add codespell action (#18818) 2024-01-17 23:03:17 -08:00
event fix: Re-use TCP connections for Kafka dials (#18860) 2024-01-24 13:10:52 -08:00
fips disable builds for go1.18 (#16332) 2022-12-30 11:37:07 -08:00
grid Add extra disconnect safety (#19022) 2024-02-09 08:43:38 -08:00
handlers send proper IPv6 names avoid bracketing notation (#18699) 2023-12-21 16:56:55 -08:00
hash add codespell action (#18818) 2024-01-17 23:03:17 -08:00
http allow configuring maximum idle connections per host (#18908) 2024-01-29 16:50:37 -08:00
init force all internal MinIO operations to be under UTC (#16009) 2022-11-04 16:44:38 -07:00
ioutil simplify deadlineWriter, re-use WithDeadline (#18948) 2024-02-02 03:02:31 -08:00
jwt allow JWT parsing on large session policy based tokens (#17167) 2023-05-09 00:53:08 -07:00
kms Update to minio/pkg/v2 (#17967) 2023-09-04 12:57:37 -07:00
lock fix: linter errors in Windows specific code (#18276) 2023-10-18 11:08:15 -07:00
logger log: Use error log type instead of Application/MinIO type (#18930) 2024-02-01 16:13:57 -08:00
lsync cleanup Go linter settings (#16736) 2023-03-04 20:57:35 -08:00
mcontext Add X-Amz-Request-Id to internode calls (#16146) 2022-12-06 09:27:26 -08:00
mountinfo add codespell action (#18818) 2024-01-17 23:03:17 -08:00
net fix: return error when requested interface has no stats available (#17666) 2023-07-17 01:14:01 -07:00
once Support persistent queue store for loggers (#17121) 2023-05-08 21:20:31 -07:00
pubsub Fix tracing send on closed channel (#18982) 2024-02-06 08:57:30 -08:00
rest add codespell action (#18818) 2024-01-17 23:03:17 -08:00
s3select add codespell action (#18818) 2024-01-17 23:03:17 -08:00
store avoid close 'nil' panics if any (#18890) 2024-01-28 10:04:17 -08:00