You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Jens-G (via GitHub)" <gi...@apache.org> on 2026/09/17 22:04:54 UTC

[PR] THRIFT-6298: Use jiffy-exact timeouts in the Rust socket split test [thrift]

Jens-G opened a new pull request, #3882:
URL: https://github.com/apache/thrift/pull/3882

   `transport::socket::tests::split_halves_must_not_clobber_each_others_timeout` (from THRIFT-5954) sets a read timeout of 250 ms and asserts that it reads back unchanged. Linux keeps socket timeouts in jiffies and rounds up, so on a kernel built with `CONFIG_HZ=250` — the Debian default — the value comes back as 252 ms:
   
   ```
   assertion `left == right` failed
     left: Some(252ms)
    right: Some(250ms)
   ```
   
   ## The change
   
   Use **240 ms** instead of 250 ms. A multiple of 20 ms is a whole number of jiffies at HZ 100, 250 and 1000 alike, so it is exact on every common kernel configuration. The test's other two values, 80 ms and 500 ms, already qualify — only the one value was wrong. A comment now records why the numbers are what they are, so the next reader does not round them back to something tidier.
   
   The assertion being tested is unaffected: it is about one half of a split socket not clobbering the other's timeout, not about any particular duration.
   
   ## Verification
   
   Measured on Debian 13, kernel 6.12, `CONFIG_HZ=250`, Rust 1.85.1:
   
   | | unpatched | patched |
   |---|---|---|
   | `split_halves_must_not_clobber_each_others_timeout` | **FAILED** — `left: Some(252ms)`, `right: Some(250ms)` | ok |
   | `cargo test --lib` | — | 178 passed, 0 failed |
   | `cargo fmt --check` | — | clean |
   | `cargo clippy --lib -- -D warnings` | — | clean |
   
   CI is green on this test today, so its runners keep 250 ms exact; this makes the test independent of that.
   
   Co-Authored-By: Claude Opus 5 (1M context) <no...@anthropic.com>
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] THRIFT-6298: Use jiffy-exact timeouts in the Rust socket split test [thrift]

Posted by "Jens-G (via GitHub)" <gi...@apache.org>.
Jens-G merged PR #3882:
URL: https://github.com/apache/thrift/pull/3882


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@thrift.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org