neofs-node icon indicating copy to clipboard operation
neofs-node copied to clipboard

Evaluate timeout CLI parameter against block time

Open roman-khimov opened this issue 1 year ago • 1 comments

So my point is: if it is possible to warn a user that some calls are useless by design, I would do it. About the rest, I am ok.

Originally posted by @notimetoname in https://github.com/nspcc-dev/neofs-node/issues/2135#issuecomment-1591240737

That's an additional delay for network settings request, but maybe it's worth doing for additional user convenience.

roman-khimov avatar Jun 16 '23 10:06 roman-khimov

i think it maybe really useful when timeout defaults

with set --timeout flag, i don't think additional request justifies itself: network resources are spent only for writing a warning. IMO it would be more efficient to attach such information to the response context along with the container ID (response X-header?). However, in this case it is useful to be able to let the server know whether the client plans to process this value or not (additional request X-header?)

if await {
  req <- new(cid, "__NEOFS__ATTACH_POLL_INTEVAL")
} else {
  req <- new(cid)
}

resp <- send(req)

if await {
  interval <- get_header(resp, "__NEOFS__ATTACH_POLL_INTEVAL")
  if interval == 0 {
    interval <- 5s // some sane default recommended by the protocol
  }
  poll(cid, interval)
}

buuut these are protocol extensions

cthulhu-rider avatar Jun 16 '23 11:06 cthulhu-rider