Skip to content

Fix for Y2038 problem #15934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Fedosin
Copy link
Contributor

@Fedosin Fedosin commented Jun 18, 2025

We expect Knative Serving to run after 2038.

Release Note

NONE

We expect Knative Serving to run after 2038.
Copy link

knative-prow bot commented Jun 18, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Fedosin
Once this PR has been reviewed and has the lgtm label, please assign skonto for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 18, 2025
@knative-prow knative-prow bot requested review from dprotaso, dsimansk and skonto June 18, 2025 11:51
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.94%. Comparing base (29e580b) to head (d9f6243).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15934      +/-   ##
==========================================
- Coverage   80.98%   80.94%   -0.05%     
==========================================
  Files         210      210              
  Lines       16780    16780              
==========================================
- Hits        13590    13582       -8     
- Misses       2840     2845       +5     
- Partials      350      353       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// NB: we need to divide by granularity, since it's a compressing mapping
// to buckets.
return int(tm.Unix()) / int(t.granularity.Seconds())
return int(tm.Unix() / int64(t.granularity.Seconds()))
Copy link
Member

Choose a reason for hiding this comment

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

Technically golang when compiling apps on 64bit host int64=int so technically this isn't an issue here.

Even with the change if were compiling on a 32bit machine you'd be converting int64 => int32 without any bounds check.

I wonder if 'modulo' is the better operation here or we should just simply fail the build on 32bit systems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants