sdnotify: Send system monotonic time on reload #1314

Merged
fyrchik merged 1 commit from elebedeva/frostfs-node:fix/go-linkname-nanotime into master 2024-08-16 10:56:16 +00:00
Member

Close #1262

Turns out that MONOTONIC_USEC field required by systemd on reload must be the system CLOCK_MONOTONIC timestamp at
the time the notification message was generated as systemd compares it to other CLOCK_MONOTONIC timestamps taken by pid1.

In the Go standard library the absolute monotonic timestamps in time.Time values are not made available to programmers.

Signed-off-by: Ekaterina Lebedeva ekaterina.lebedeva@yadro.com

Close #1262 Turns out that `MONOTONIC_USEC` field required by `systemd` on reload must be the system `CLOCK_MONOTONIC` timestamp at the time the notification message was generated as `systemd` compares it to other `CLOCK_MONOTONIC` timestamps taken by pid1. In the Go standard library the absolute monotonic timestamps in `time.Time` values are not made available to programmers. Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
elebedeva added the
frostfs-ir
frostfs-node
internal
labels 2024-08-15 14:22:22 +00:00
elebedeva requested review from storage-core-committers 2024-08-15 14:23:05 +00:00
elebedeva requested review from storage-core-developers 2024-08-15 14:23:07 +00:00
acid-ant approved these changes 2024-08-15 14:35:07 +00:00
fyrchik requested changes 2024-08-15 16:31:38 +00:00
@ -17,6 +20,7 @@ const (
var (
socket *net.UnixAddr
errMonotonicClockNotAvaliable = errors.New("unable to send RELOADING: monotonic clock is not available on this system")
Owner

unable to send RELOADING will be logged by the outer function, no need to include context here
is not available can be misleading, there are multiple possible return codes for this syscall.
How about return fmt.Errorf("clock_gettime: %w", err) in the function, without this variable?

`unable to send RELOADING` will be logged by the outer function, no need to include context here `is not available` can be misleading, there are multiple possible return codes for this syscall. How about `return fmt.Errorf("clock_gettime: %w", err)` in the function, without this variable?
Author
Member

fixed

fixed
elebedeva force-pushed fix/go-linkname-nanotime from 7a189b0967 to ec1509de4e 2024-08-16 09:06:08 +00:00 Compare
acid-ant approved these changes 2024-08-16 09:45:06 +00:00
fyrchik approved these changes 2024-08-16 10:56:09 +00:00
fyrchik merged commit ec1509de4e into master 2024-08-16 10:56:15 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
3 participants
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: TrueCloudLab/frostfs-node#1314
No description provided.