minio/pkg/dsync
Harshavardhana 0104af6bcc
delayed locks until we have started reading the body (#10474)
This is to ensure that Go contexts work properly, after some
interesting experiments I found that Go net/http doesn't
cancel the context when Body is non-zero and hasn't been
read till EOF.

The following gist explains this, this can lead to pile up
of go-routines on the server which will never be canceled
and will die at a really later point in time, which can
simply overwhelm the server.

https://gist.github.com/harshavardhana/c51dcfd055780eaeb71db54f9c589150

To avoid this refactor the locking such that we take locks after we
have started reading from the body and only take locks when needed.

Also, remove contextReader as it's not useful, doesn't work as expected
context is not canceled until the body reaches EOF so there is no point
in wrapping it with context and putting a `select {` on it which
can unnecessarily increase the CPU overhead.

We will still use the context to cancel the lockers etc.
Additional simplification in the locker code to avoid timers
as re-using them is a complicated ordeal avoid them in
the hot path, since locking is very common this may avoid
lots of allocations.
2020-09-14 15:57:13 -07:00
..
.gitignore Support MinIO to be deployed on more than 32 nodes (#8492) 2019-11-13 12:17:45 -08:00
drwmutex.go delayed locks until we have started reading the body (#10474) 2020-09-14 15:57:13 -07:00
drwmutex_test.go allow lock tolerance to match storage-class drive tolerance (#10270) 2020-08-14 18:17:14 -07:00
dsync-server_test.go fix: Speed up multi-object delete by taking bulk locks (#8974) 2020-02-21 11:29:57 +05:30
dsync.go Implement bucket expansion (#8509) 2019-11-19 17:42:27 -08:00
dsync_test.go allow lock tolerance to match storage-class drive tolerance (#10270) 2020-08-14 18:17:14 -07:00
rpc-client-impl_test.go fix: Pass context all the way down to the network call in lockers (#10161) 2020-07-29 23:15:34 -07:00
rpc-client-interface.go fix: Pass context all the way down to the network call in lockers (#10161) 2020-07-29 23:15:34 -07:00