You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "emanuele-em (via GitHub)" <gi...@apache.org> on 2026/10/16 09:26:48 UTC

[PR] fix: restore floating-point rounding mode after panic [datafusion]

emanuele-em opened a new pull request, #26412:
URL: https://github.com/apache/datafusion/pull/26412

   ## Which issue does this PR close?
   
   - Closes #7356.
   
   ## Rationale for this change
   
   A caught panic in `alter_fp_rounding_mode` leaves the thread using the temporary rounding mode, which can affect later floating-point calculations on that thread.
   
   ## What changes are included in this PR?
   
   Restore the saved rounding mode with a private `Drop` guard so cleanup also runs during unwinding. The change is confined to `rounding.rs` and adds no dependency or public API.
   
   ## What is the testing strategy for this PR?
   
   The regression test starts in downward rounding mode, panics during an upward-rounded operation, catches the panic, and checks that downward rounding was restored. It restores the test thread's original mode before asserting. This requires a Rust unit test because SQL and the DataFrame API cannot directly supply the panicking callback.
   
   The test was run against the unfixed implementation and failed because upward rounding remained active.
   
   Validation:
   
   - `cargo fmt --all` and `cargo fmt --all -- --check` passed.
   - `cargo test --profile ci -p datafusion-common -p datafusion-expr-common` passed: 847 unit tests and 89 documentation tests, with five documentation tests ignored.
   
   `cargo clippy --all-targets --all-features -- -D warnings` reported three pre-existing `mutable_key_type` errors in `datafusion/optimizer/src/push_down_filter.rs`, tracked by #26181. Its remaining bundled Protobuf build was stopped after these errors.
   
   The full lint suite, SQL logic suite, and extended workspace tests were started but did not complete locally. The separate core and CLI test run was not reached.
   
   ## Are there any user-facing changes?
   
   After a caught panic, subsequent floating-point calculations on the same thread retain the rounding mode that was active before the operation. No public API or normal SQL behavior changes.
   


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] fix: restore floating-point rounding mode after panic [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 merged PR #26412:
URL: https://github.com/apache/datafusion/pull/26412


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] fix: restore floating-point rounding mode after panic [datafusion]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26412:
URL: https://github.com/apache/datafusion/pull/26412#issuecomment-6247953447

   <!-- semver-check-comment -->
   Thank you for opening this pull request!
   
   Reviewer note: [cargo-semver-checks](https://github.com/obi1kenobi/cargo-semver-checks) reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch).
   
   <details>
   <summary>Details</summary>
   
   ```
        Cloning apache/main
       Building datafusion-common v55.1.0 (current)
          Built [  35.010s] (current)
        Parsing datafusion-common v55.1.0 (current)
         Parsed [   0.066s] (current)
       Building datafusion-common v55.1.0 (baseline)
          Built [  32.654s] (baseline)
        Parsing datafusion-common v55.1.0 (baseline)
         Parsed [   0.069s] (baseline)
       Checking datafusion-common v55.1.0 -> v55.1.0 (no change; assume patch)
        Checked [   0.708s] 229 checks: 228 pass, 1 fail, 0 warn, 31 skip
   
   --- failure enum_missing: pub enum removed or renamed ---
   
   Description:
   A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
           ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
          impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.51.0/src/lints/enum_missing.ron
   
   Failed in:
     enum datafusion_common::parquet_config::DFTimeUnit, previously in file /home/runner/work/datafusion/datafusion/target/semver-checks/git-apache_main/5e6920bb743b27e427b9f64417e4c11f3974fe00/datafusion/common/src/parquet_config.rs:489
   
        Summary semver requires new major version: 1 major and 0 minor checks failed
       Finished [  69.975s] datafusion-common
   ```
   
   </details>


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] fix: restore floating-point rounding mode after panic [datafusion]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #26412:
URL: https://github.com/apache/datafusion/pull/26412#issuecomment-6248194610

   ## [Codecov](https://app.codecov.io/gh/apache/datafusion/pull/26412?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 82.87%. Comparing base ([`b6f6990`](https://app.codecov.io/gh/apache/datafusion/commit/b6f6990ed5f926fd04fe04c46410f8c6ddfb7674?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`71bc0bb`](https://app.codecov.io/gh/apache/datafusion/commit/71bc0bbdd0dd3622a608236ac1946aab038aa4ca?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 17 commits behind head on main.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             main   #26412      +/-   ##
   ==========================================
   - Coverage   82.87%   82.87%   -0.01%     
   ==========================================
     Files        1153     1153              
     Lines      457124   457139      +15     
     Branches   457124   457139      +15     
   ==========================================
   + Hits       378847   378852       +5     
   - Misses      55264    55271       +7     
   - Partials    23013    23016       +3     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/datafusion/pull/26412?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org