A particular status code does not imply that a connection has not been
established. However, `Dial()` requires user to call `Close()` only if
the error was nil. Thus, it is `Dial()` responsibility to close
everything if it returns an error.
Introduced after the gRPC update in #270 (6009d089fc).
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
After removing `grpc.Dial` from client `DialTimeout` used only if
custom dialer provided. Client uses `BalanceOf` instead of `grpc.Dial`,
so it is required to use `DialTimeout` to not to use RPC timeout.
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
The previous policy target generated device-specific comments
(e.g., `/home/john_doe/repos/<...>`), which could result in
unnecessary file changes This behavior would confuse git and
require manual changes to resolve. The update ensures comments
are now device-agnostic, preventing unwanted changes.
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
After api-go upgrade created client doesn't establish connection after created,
so RPC call is required to establish and check connection.
RPC call returns status error, so conversion from status error to context error
is required to satisfy Dial contract and unit tests.
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
* Make the method `PatchPayload` send a patch with empty
payload patch if range's length is non-zero and if it's the
first call.
* Empty payload patches just cut original object payload. So, these
patches are also valid.
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
* The flag 'firstPayloadPatch' keeps its state after first
`PatchPayload` that make other calls incorrectly set patch
ranges.
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
Since Go 1.22 a `for` statement with a `range` clause is able
to iterate through integer values from zero to an upper limit.
gopatch script:
@@
var i, e expression
@@
-for i := 0; i <= e - 1; i++ {
+for i := range e {
...
}
@@
var i, e expression
@@
-for i := 0; i <= e; i++ {
+for i := range e + 1 {
...
}
@@
var i, e expression
@@
-for i := 0; i < e; i++ {
+for i := range e {
...
}
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
Remove `client.ContainerEACL` and related references. This change
was initiated by the removal of `ContainerService.GetExtendedACL`
from the API.
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
Previously we count all frostfs errors like:
ObjectNotFound, EACLNotFound
because frostfs status is unconditionally resolved into built-in go errors
but handleError method handled built-in errors like internal network ones.
Since after resolving frostfs errors status is also returned we start check this first
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
* Introduce `patcher` package that contains such interfaces to be
implemented:
- `PatchApplier` - the main patching engine that merges the stream
of patches and the stream of original object payload divided by
ranges. The merged streams result is output to `ChunkedObjectWriter`;
- `RangeProvider` - provides the original object payload by ranges;
- `HeaderProvider` - provides the original object header.
* Introduce `patcher` that implements `PatchApplier`;
* Cover all possible cases with unit-tests.
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>