You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "gortiz (via GitHub)" <gi...@apache.org> on 2026/02/19 08:25:30 UTC

[PR] Refactor exception handling to use ExceptionUtils for better suppression of multiple exceptions [pinot]

gortiz opened a new pull request, #17724:
URL: https://github.com/apache/pinot/pull/17724

   This pull request introduces utility methods to simplify and standardize exception suppression and aggregation across the codebase. The main addition is the new `ExceptionUtils.suppress` methods, which help collect and chain exceptions (especially when closing multiple resources or handling multiple failures) without losing any exception details. Existing code is refactored to use these utilities, improving readability and reducing boilerplate.
   
   **Key changes:**
   
   **1. New utility methods for exception suppression:**
   - Added two overloaded `suppress` methods in `ExceptionUtils`:
     - One for suppressing exceptions of the same type.
     - One for suppressing exceptions of different types, with conversion support.
     - Both methods ensure that suppressed exceptions are not lost and avoid infinite loops if the same exception instance is reused.
   
   **2. Refactoring to use the new utility methods:**
   - Updated exception suppression logic in `FileUtils.close`, `BlockExchange.send`, `BlockExchange.close`, `BaseTableDataManager.reloadSegment`, and `SegmentIndexCreationDriverImpl.buildColumnar` to use `ExceptionUtils.suppress` instead of manual suppression. This reduces code duplication and potential errors. [[1]](diffhunk://#diff-6f11fcc30444e1d02ec4120820ac3a2d0949e2b6247cacb15b11f3dd63ea7f79L95-R95) [[2]](diffhunk://#diff-08e624917f683f47e32cf511e53a41a95570a1973e5e7c737a736c37f0826d23L146-R147) [[3]](diffhunk://#diff-08e624917f683f47e32cf511e53a41a95570a1973e5e7c737a736c37f0826d23L186-R183) [[4]](diffhunk://#diff-942fbcffeb29824589de999671b7649b8b83e3fc82bdbc3b1e8eaed9f8096520L926-R927) [[5]](diffhunk://#diff-f763128c9fa6c9e326c49f192c66d68799df68e4b3212bebf8fd4891c894132bL644-R645)
   
   **3. Dependency and import updates:**
   - Added necessary imports for `ExceptionUtils` in files that now use the new suppression methods. [[1]](diffhunk://#diff-942fbcffeb29824589de999671b7649b8b83e3fc82bdbc3b1e8eaed9f8096520R62) [[2]](diffhunk://#diff-08e624917f683f47e32cf511e53a41a95570a1973e5e7c737a736c37f0826d23R26) [[3]](diffhunk://#diff-f763128c9fa6c9e326c49f192c66d68799df68e4b3212bebf8fd4891c894132bR35) [[4]](diffhunk://#diff-9dd65aaa718a21ab61552930d26df1dc2ddfa5a9f91957d61fe238aac9756cadR21-R22)
   
   **4. Documentation and comments:**
   - Provided detailed Javadoc and usage examples for the new `suppress` methods to guide developers on correct usage and to clarify the intended scenarios.
   
   **5. Notes on module boundaries:**
   - Added a comment in `PagedPinotOutputStream.close` explaining why the new utility cannot be used there due to module dependencies.


-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Refactor exception handling to use ExceptionUtils for better suppression of multiple exceptions [pinot]

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

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/17724?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `0%` with `18 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 34.03%. Comparing base ([`657e7f0`](https://app.codecov.io/gh/apache/pinot/commit/657e7f075f7a5d41c45565f4bc5247ca3b4f7293?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3ae7faa`](https://app.codecov.io/gh/apache/pinot/commit/3ae7faadbdb160446d3430f8810a12b418f1417b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 11 commits behind head on master.
   :white_check_mark: All tests successful. No failed tests found.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/17724?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [.../org/apache/pinot/common/utils/ExceptionUtils.java](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&filepath=pinot-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fcommon%2Futils%2FExceptionUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vdXRpbHMvRXhjZXB0aW9uVXRpbHMuamF2YQ==) | 0.00% | [12 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...query/runtime/operator/exchange/BlockExchange.java](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&filepath=pinot-query-runtime%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fquery%2Fruntime%2Foperator%2Fexchange%2FBlockExchange.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtcXVlcnktcnVudGltZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvcXVlcnkvcnVudGltZS9vcGVyYXRvci9leGNoYW5nZS9CbG9ja0V4Y2hhbmdlLmphdmE=) | 0.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [.../java/org/apache/pinot/common/utils/FileUtils.java](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&filepath=pinot-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fcommon%2Futils%2FFileUtils.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vdXRpbHMvRmlsZVV0aWxzLmphdmE=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [.../pinot/core/data/manager/BaseTableDataManager.java](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&filepath=pinot-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fcore%2Fdata%2Fmanager%2FBaseTableDataManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL21hbmFnZXIvQmFzZVRhYmxlRGF0YU1hbmFnZXIuamF2YQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...t/creator/impl/SegmentIndexCreationDriverImpl.java](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&filepath=pinot-segment-local%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fsegment%2Flocal%2Fsegment%2Fcreator%2Fimpl%2FSegmentIndexCreationDriverImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc2VnbWVudC1sb2NhbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VnbWVudC9sb2NhbC9zZWdtZW50L2NyZWF0b3IvaW1wbC9TZWdtZW50SW5kZXhDcmVhdGlvbkRyaXZlckltcGwuamF2YQ==) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...not/segment/spi/memory/PagedPinotOutputStream.java](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&filepath=pinot-segment-spi%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fsegment%2Fspi%2Fmemory%2FPagedPinotOutputStream.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc2VnbWVudC1zcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3Bpbm90L3NlZ21lbnQvc3BpL21lbW9yeS9QYWdlZFBpbm90T3V0cHV0U3RyZWFtLmphdmE=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/17724?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (657e7f0) and HEAD (3ae7faa). Click for more details.
   > 
   > <details><summary>HEAD has 36 uploads less than BASE</summary>
   >
   >| Flag | BASE (657e7f0) | HEAD (3ae7faa) |
   >|------|------|------|
   >|java-21|5|1|
   >|unittests1|2|0|
   >|unittests|4|1|
   >|temurin|10|1|
   >|java-11|5|0|
   >|unittests2|2|1|
   >|integration|6|0|
   >|integration2|2|0|
   >|integration1|2|0|
   >|custom-integration1|2|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             master   #17724       +/-   ##
   =============================================
   - Coverage     63.23%   34.03%   -29.21%     
   + Complexity     1502      775      -727     
   =============================================
     Files          3179     3181        +2     
     Lines        190710   190818      +108     
     Branches      29153    29163       +10     
   =============================================
   - Hits         120597    64943    -55654     
   - Misses        60746   120482    +59736     
   + Partials       9367     5393     -3974     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration1](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration2](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-11](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-21](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `34.03% <0.00%> (-29.15%)` | :arrow_down: |
   | [temurin](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `34.03% <0.00%> (-29.21%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `34.03% <0.00%> (-29.20%)` | :arrow_down: |
   | [unittests1](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unittests2](https://app.codecov.io/gh/apache/pinot/pull/17724/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `34.03% <0.00%> (-0.04%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/17724?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>
   
   - :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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] Refactor exception handling to use ExceptionUtils for better suppression of multiple exceptions [pinot]

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


-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org