Skip to content

fix: deadline calculation in PbjProtocolHandler#840

Open
jnels124 wants to merge 1 commit into
mainfrom
jtn-839
Open

fix: deadline calculation in PbjProtocolHandler#840
jnels124 wants to merge 1 commit into
mainfrom
jtn-839

Conversation

@jnels124
Copy link
Copy Markdown

Description:

Fix PbjProtocolHandler.scheduleDeadline to compute the server-side deadline as System.nanoTime() + durationNanos instead of System.nanoTime() * durationNanos, preventing immediate DEADLINE_EXCEEDED on all timed inbound gRPC calls.

  • Fix multiplication operator (*) to addition (+) in scheduleDeadline deadline computation
  • Add capturedDeadlineNanos field to DeadlineDetectorStub to record the value passed by scheduleDeadline
  • Add test scheduleDeadlinePassesPositiveFutureNanosToDetector asserting the deadline is positive and falls within the expected [nanoTime + timeout] window

Related issue(s):

Fixes #839

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@jnels124 jnels124 self-assigned this May 21, 2026
@jnels124 jnels124 requested review from a team as code owners May 21, 2026 05:01
Signed-off-by: Jesse Nelson <jesse@hashgraph.com>
@github-actions
Copy link
Copy Markdown

JUnit Test Report

   521 files  ±0     521 suites  ±0   27s ⏱️ -1s
 1 520 tests +1   1 516 ✅ +1   4 💤 ±0  0 ❌ ±0 
10 408 runs  +1  10 380 ✅ +1  28 💤 ±0  0 ❌ ±0 

Results for commit 5109126. ± Comparison against base commit 03830e4.

@jnels124 jnels124 added the Bug An error that causes the feature to behave differently than what was expected based on design. label May 21, 2026
@github-actions
Copy link
Copy Markdown

Integration Test Report

    426 files  ±0      426 suites  ±0   16m 33s ⏱️ - 3m 2s
115 030 tests ±0  115 030 ✅ ±0  0 💤 ±0  0 ❌ ±0 
115 274 runs  ±0  115 274 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 5109126. ± Comparison against base commit 03830e4.

This pull request removes 2 and adds 2 tests. Note that renamed tests count towards both.
com.hedera.pbj.integration.test.ParserNeverWrapsTest ‑ [1] com.hedera.pbj.integration.test.ParserNeverWrapsTest$$Lambda/0x0000000041c78a38@25315eb9
com.hedera.pbj.integration.test.ParserNeverWrapsTest ‑ [2] com.hedera.pbj.integration.test.ParserNeverWrapsTest$$Lambda/0x0000000041c78c80@6f2d916f
com.hedera.pbj.integration.test.ParserNeverWrapsTest ‑ [1] com.hedera.pbj.integration.test.ParserNeverWrapsTest$$Lambda/0x0000000098c8f200@69424ebd
com.hedera.pbj.integration.test.ParserNeverWrapsTest ‑ [2] com.hedera.pbj.integration.test.ParserNeverWrapsTest$$Lambda/0x0000000098c8f448@308f9543

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug An error that causes the feature to behave differently than what was expected based on design.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deadline calculation appears to be incorrect

1 participant