Check usage of time.Time #80

Closed
opened 2025-12-28 17:36:03 +00:00 by sami · 3 comments
Owner

Originally created by @alexvanin on GitHub (Oct 17, 2022).

Originally assigned to: @KirillovDenis on GitHub.

Gateway should live in the environment without NTP and pretty much unstable time flow.

In this issue collect all available places where things can go wrong with wall time and discuss it with @realloc and @alexvanin

Originally created by @alexvanin on GitHub (Oct 17, 2022). Originally assigned to: @KirillovDenis on GitHub. Gateway should live in the environment without NTP and pretty much unstable time flow. In this issue collect all available places where things can go wrong with wall time and discuss it with @realloc and @alexvanin
sami 2025-12-28 17:36:03 +00:00
  • closed this issue
  • added the
    U2
    label
Author
Owner

@KirillovDenis commented on GitHub (Oct 18, 2022):

Currently, we use time.Time in the following cases:

  1. To measure elapsed time of requests
  2. To set object attribute Timestamp and convert it to Last-Modified header
  3. To set modified time to files in zip archive
  4. To compute object attribute __NEOFS__EXPIRATION_EPOCH

It seems the problem is only the last case (expiration attribute). We support the following headers:

  • X-Attribute-Neofs-Expiration-Epoch: 100
  • X-Attribute-Neofs-Expiration-Duration: 24h30m
  • X-Attribute-Neofs-Expiration-Timestamp: 1637574797
  • X-Attribute-Neofs-Expiration-RFC3339: 2021-11-22T09:55:49Z

Probably we can keep only Expiration-Epoch and Expiration-Duration.

@KirillovDenis commented on GitHub (Oct 18, 2022): Currently, we use time.Time in the following cases: 1. To measure elapsed time of requests 2. To set object attribute `Timestamp` and convert it to `Last-Modified` header 3. To set `modified` time to files in zip archive 4. To compute object attribute `__NEOFS__EXPIRATION_EPOCH` It seems the problem is only the last case (expiration attribute). We support the following headers: * `X-Attribute-Neofs-Expiration-Epoch: 100` * `X-Attribute-Neofs-Expiration-Duration: 24h30m` * `X-Attribute-Neofs-Expiration-Timestamp: 1637574797` * `X-Attribute-Neofs-Expiration-RFC3339: 2021-11-22T09:55:49Z` Probably we can keep only `Expiration-Epoch` and `Expiration-Duration`.
Author
Owner

@alexvanin commented on GitHub (Nov 1, 2022):

  1. Check monotonic timer
  2. Nothing we can do
  3. Nothing we can do
  4. Can we check request sender local time? We can get diff between current end expiration time and use to set duration. No new header required.
@alexvanin commented on GitHub (Nov 1, 2022): 1. Check monotonic timer 2. Nothing we can do 3. Nothing we can do 4. Can we check request sender local time? We can get diff between current end expiration time and use to set duration. No new header required.
Author
Owner

@KirillovDenis commented on GitHub (Nov 7, 2022):

1 - We already use it (time.Since()).
4 - It seems we can use the Date header.

@KirillovDenis commented on GitHub (Nov 7, 2022): 1 - We already use it (`time.Since()`). 4 - It seems we can use the `Date` [header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-http-gw#80
No description provided.