In previous implementation `Client` passed `context.Background()` to
`grpc.DialContext` function. This didn't allow to abort dial stage by
the given context.
Base dial context on the one provided with `WithContext` option. Fall
back to using `context.Background` if context is not specified.
Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
In previous implementation `Client` didn't block until the connection is
up on dial stage. This caused the dial timeout to have no effect.
Provide `WithBlock` dial option to `DialContext` call in `openGRPCConn`
method. From now `Client` blocks for configured timeout until the
connection is up.
Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
`grpc.WithInsecure` has been marked as deprecated in earlier releases of
`google.golang.org/grpc`.
Use `google.golang.org/grpc/credentials/insecure` package instead as
recommended.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
`expiration_epoch` field of `StorageGroup` message has been marked as
deprecated in previous NeoFS API protocol's release.
Mark all method related to the field as deprecated. Leave and use them
for test purposes only.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Container could now have "__NEOFS__DISABLE_HOMOMORPHIC_HASHING" well-known
attribute. Setting that to "true" means disabling homomorphic hashing for
objects that belong to that container, any other cases mean that homomorphic
hashing is enabled.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Chained verification is done in a single thread there is no need to use
pool to do this. Also because newly allocated items are 5 MiB in size
we can run out of memory given that typical header it much less in size.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
From the docs of `time.After`:
```
The underlying Timer is not recovered by the garbage collector until the timer fires.
```
We have 1 minute default timeout, which is pretty long given that most
of the time we exchange small messages.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
I knew one day `sed` would save me an hour of manual work:
```
sed -i -n -e '
s/) Set/) Set/
p
t setter
b end
:setter
n
s/nil/nil/
t hasif
p
b end
:hasif
n
:loop
p
n
s/}/}/
t end
b loop
:end
' $@
goimports -w $@
```
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
The speed of copying (which is done regulary for e.g. subnet changes)
is less, however it isn't on the hot path and the absolute time
difference is insignificant.
```
name old time/op new time/op delta
NodeAttributes-8 96.2ns ± 1% 158.3ns ± 1% +64.61% (p=0.000 n=10+10)
name old alloc/op new alloc/op delta
NodeAttributes-8 32.0B ± 0% 32.0B ± 0% ~ (all equal)
name old allocs/op new allocs/op delta
NodeAttributes-8 2.00 ± 0% 2.00 ± 0% ~ (all equal)
```
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>