You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "XuQianJin-Stars (via GitHub)" <gi...@apache.org> on 2023/12/21 03:40:21 UTC

[PR] [fix] Error in obtaining network card related information under linux or mac os [pulsar]

XuQianJin-Stars opened a new pull request, #21773:
URL: https://github.com/apache/pulsar/pull/21773

   Fix error in obtaining network card related information under linux or mac os
   
   <!-- Details of when a PIP is required and how the PIP process work, please see: https://github.com/apache/pulsar/blob/master/pip/README.md -->
   
   ### Motivation
   
   <!-- Explain here the context, and why you're making that change. What is the problem you're trying to solve. -->
   ![企业微信截图_45b27c2b-b570-4951-8333-dbc628abeb01](https://github.com/apache/pulsar/assets/10494131/b7247d4c-6fcd-49aa-9904-4d249da437db)
   
   
   ### Modifications
   
   <!-- Describe the modifications you've done. -->
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
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@pulsar.apache.org

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


Re: [PR] [fix] Error in obtaining network card related information under linux or mac os [pulsar]

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

   @XuQianJin-Stars Please add the following content to your PR description and select a checkbox:
   ```
   - [ ] `doc` <!-- Your PR contains doc changes -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   ```


-- 
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@pulsar.apache.org

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


Re: [PR] [fix] Error in obtaining network card related information under linux or mac os [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on PR #21773:
URL: https://github.com/apache/pulsar/pull/21773#issuecomment-6353825363

   Thanks @XuQianJin-Stars, and sorry this sat so long. I'm closing this as part of the open-PR backlog triage (https://lists.apache.org/thread/cgy7w0qgnq8s7j0ykyzgrn3hj4nb67wf). Master's NIC logic hasn't changed, but the build moved to Gradle, and on macOS the broker uses `GenericBrokerHostUsageImpl`, so this code never runs there. Switching to OSHI doesn't change what gets read on Linux, and its `isVirtual()` check would risk dropping `eth0` inside containers (see #18812). If you've hit wrong bandwidth numbers on a specific Linux setup, please open an issue with the `/sys/class/net/*/{type,speed,operstate}` values, and we can fix the filtering directly. Meanwhile, `loadBalancerOverrideBrokerNicSpeedGbps` lets you pin the limit.
   


-- 
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@pulsar.apache.org

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


Re: [PR] [fix] Error in obtaining network card related information under linux or mac os [pulsar]

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

   ## [Codecov](https://app.codecov.io/gh/apache/pulsar/pull/21773?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: `19 lines` in your changes are missing coverage. Please review.
   > Comparison is base [(`99d06b9`)](https://app.codecov.io/gh/apache/pulsar/commit/99d06b94fa715b3f1062c4a3f616d5cc725e47a4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 73.58% compared to head [(`1b95bf0`)](https://app.codecov.io/gh/apache/pulsar/pull/21773?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 73.55%.
   > Report is 6 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/pulsar/pull/21773/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/pulsar/pull/21773?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #21773      +/-   ##
   ============================================
   - Coverage     73.58%   73.55%   -0.03%     
   + Complexity    32254    32240      -14     
   ============================================
     Files          1858     1859       +1     
     Lines        138021   138040      +19     
     Branches      15111    15121      +10     
   ============================================
   - Hits         101558   101540      -18     
   - Misses        28606    28626      +20     
   - Partials       7857     7874      +17     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pulsar/pull/21773/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [inttests](https://app.codecov.io/gh/apache/pulsar/pull/21773/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `24.19% <47.54%> (+0.01%)` | :arrow_up: |
   | [systests](https://app.codecov.io/gh/apache/pulsar/pull/21773/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `23.71% <52.45%> (-0.07%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pulsar/pull/21773/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `72.82% <68.85%> (-0.05%)` | :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.
   
   | [Files](https://app.codecov.io/gh/apache/pulsar/pull/21773?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...ache/pulsar/client/impl/MemoryLimitController.java](https://app.codecov.io/gh/apache/pulsar/pull/21773?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC9pbXBsL01lbW9yeUxpbWl0Q29udHJvbGxlci5qYXZh) | `93.75% <89.47%> (-1.81%)` | :arrow_down: |
   | [...org/apache/pulsar/broker/loadbalance/OshiUtil.java](https://app.codecov.io/gh/apache/pulsar/pull/21773?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9Pc2hpVXRpbC5qYXZh) | `38.46% <38.46%> (ø)` | |
   | [...ache/pulsar/broker/loadbalance/LinuxInfoUtils.java](https://app.codecov.io/gh/apache/pulsar/pull/21773?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9sb2FkYmFsYW5jZS9MaW51eEluZm9VdGlscy5qYXZh) | `57.52% <68.96%> (+1.17%)` | :arrow_up: |
   
   ... and [69 files with indirect coverage changes](https://app.codecov.io/gh/apache/pulsar/pull/21773/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   </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@pulsar.apache.org

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


Re: [PR] [fix] Error in obtaining network card related information under linux or mac os [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat closed pull request #21773: [fix] Error in obtaining network card related information under linux or mac os
URL: https://github.com/apache/pulsar/pull/21773


-- 
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@pulsar.apache.org

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


Re: [PR] [fix] Error in obtaining network card related information under linux or mac os [pulsar]

Posted by "XuQianJin-Stars (via GitHub)" <gi...@apache.org>.
XuQianJin-Stars commented on PR #21773:
URL: https://github.com/apache/pulsar/pull/21773#issuecomment-1867134794

   > Why involves `hutool`?
   
   Well, I'll add a class to remove this dependency.


-- 
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@pulsar.apache.org

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