Skip to content

Conversation

@ym
Copy link
Contributor

@ym ym commented Jun 12, 2025

Fixes #576

A temporary workaround before the next release would be to disable HTTP sync.

@ym ym requested a review from Copilot June 12, 2025 22:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where queryMultipleHttp hangs if all servers are unreachable by ensuring that each goroutine sends a result (even if nil) and the loop properly iterates over all responses until a valid result is found.

  • Ensure each error case sends a nil result to the channel.
  • Replace a single channel read with a for-loop that iterates over all expected responses and returns early on a non-nil result.
Comments suppressed due to low confidence (1)

internal/timesync/http.go:114

  • Clarify in the function documentation whether returning on the first non-nil result is the intended behavior, to prevent any confusion on the API's usage.
now = result


return <-results
for range urls {
result := <-results
Copy link

Copilot AI Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a comment explaining why nil results are explicitly skipped to enhance readability.

Suggested change
result := <-results
result := <-results
// Skip nil results as they indicate failed or canceled HTTP queries.

Copilot uses AI. Check for mistakes.
@ym ym merged commit 1987151 into jetkvm:dev Jun 12, 2025
5 checks passed
ariedel87 pushed a commit to ariedel87/kvm that referenced this pull request Jun 13, 2025
ym added a commit to ym/jetkvm-kvm that referenced this pull request Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] NTP is not retried if network not present at boot

2 participants