Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dfarr
Copy link
Member

@dfarr dfarr commented Sep 15, 2025

The max possible ttl is now 9223372036854775807ms or ~292471208.677536 years.

On heartbeat, we calculate the sum of the current time in ms and the ttl value. Because this calculation happens in the database query, there is no good way to clamp this value to avoid overflow. I propose we set reasonable maximums for the following values:

  • the current time in ms
  • the ttl

Setting a bound on the current time will actually be pretty easy because we can do it in assert at the top of the tick. We can choose a value so ridiculously large that the clock should never hit it even in a simulation. If this assertion is triggered, it is likely somebody is messing with the machines clock.

Then we would just need to choose a max ttl value such that:

max_clock + ttl <= 9223372036854775807

But let's create an issue for this and do it later.

@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

❌ Patch coverage is 77.15232% with 69 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.33%. Comparing base (436edf7) to head (bda1306).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ternal/app/subsystems/api/grpc/pb/callback_t.pb.go 7.69% 21 Missing and 3 partials ⚠️
internal/app/subsystems/api/grpc/pb/task.pb.go 81.39% 8 Missing ⚠️
...nternal/app/subsystems/api/grpc/pb/promise_t.pb.go 30.00% 7 Missing ⚠️
internal/app/subsystems/api/grpc/pb/promise.pb.go 92.40% 5 Missing and 1 partial ⚠️
...nternal/app/subsystems/api/grpc/pb/lock_grpc.pb.go 71.42% 3 Missing and 1 partial ⚠️
...rnal/app/subsystems/api/grpc/pb/promise_grpc.pb.go 84.61% 3 Missing and 1 partial ⚠️
...nal/app/subsystems/api/grpc/pb/schedule_grpc.pb.go 75.00% 3 Missing and 1 partial ⚠️
...ternal/app/subsystems/api/grpc/pb/schedule_t.pb.go 33.33% 4 Missing ⚠️
...nternal/app/subsystems/api/grpc/pb/task_grpc.pb.go 75.00% 3 Missing and 1 partial ⚠️
internal/app/subsystems/api/grpc/pb/lock.pb.go 96.15% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #812      +/-   ##
==========================================
+ Coverage   48.66%   50.33%   +1.66%     
==========================================
  Files         123      123              
  Lines       14559    14011     -548     
==========================================
- Hits         7085     7052      -33     
+ Misses       7008     6499     -509     
+ Partials      466      460       -6     

☔ 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.

@dfarr dfarr mentioned this pull request Sep 16, 2025
@dfarr dfarr merged commit 6b5ade4 into main Sep 16, 2025
7 checks passed
@dfarr dfarr deleted the feature/ttl-bigint branch September 16, 2025 18:49
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.

3 participants