Skip to content

Conversation

@jakubno
Copy link
Member

@jakubno jakubno commented Sep 29, 2025

Description

Sometimes the time isn't synced, pass the time directly from orchestrator. It will then be kept synchronized by chrony

Some extra logs during debugging

[2025-09-29 12:37:31.929Z] DEBUG { logger: 'envd', message: 'Setting system time. Current time: 2025-09-29 12:37:31.929714537 +0000 UTC m=+30.861367653', operation_id: '4' }
[2025-09-29 12:37:31.929Z] DEBUG { logger: 'envd', message: 'Setting sandbox start time to: 2025-09-29 12:37:32.159826264 +0000 UTC', operation_id: '4' }
[2025-09-29 12:37:32.159Z] DEBUG { logger: 'envd', message: 'Setting system time set inside sandbox. Current time: 2025-09-29 12:37:32.159839457 +0000 UTC m=+30.861521162', operation_id: '4' }

Note

Pass current time from orchestrator to envd via PostInit to sync sandbox clock; update spec, generated code, and version.

  • API/Spec:
    • Add optional timestamp (RFC3339 date-time) to POST /init in packages/envd/spec/envd.yaml.
    • Regenerate models to include PostInitJSONBody.Timestamp in packages/envd/internal/api/api.gen.go and tests' tests/integration/internal/envd/api/models.gen.go.
  • envd:
    • In internal/api/init.go, if timestamp is provided, set system time using unix.ClockSettime.
    • Improve JSON decode EOF check using errors.Is.
  • Orchestrator:
    • In internal/sandbox/envd.go, include current time in /init request (PostInitJSONBody.Timestamp = time.Now()).
  • Misc:
    • Bump Version to 0.3.4 in packages/envd/main.go.

Written by Cursor Bugbot for commit 5248c47. This will update automatically on new commits. Configure here.

@jakubno jakubno added the bug Something isn't working label Sep 29, 2025
@linear
Copy link

linear bot commented Sep 29, 2025

@jakubno jakubno enabled auto-merge (squash) September 29, 2025 12:50
@jakubno jakubno merged commit ff5ea68 into main Sep 29, 2025
25 checks passed
@jakubno jakubno deleted the fix-clocksync-issue-by-passing-the-time-directly-eng-3082 branch September 29, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants