Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use parseUnsignedLong for getNetIoCountersLinux#27966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
keith wants to merge1 commit intobazelbuild:master
base:master
Choose a base branch
Loading
fromkeith:ks/use-parseunsignedlong-for-getnetiocounterslinux

Conversation

@keith
Copy link
Member

We had some users have this logic fail because of huge values in
/proc/net/dev like 10586847412485054478.

FATAL: bazel crashed due to an internal error. Printing stack trace:java.lang.NumberFormatException: For input string: "10586847412485054478"at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)at java.base/java.lang.Long.parseLong(Unknown Source)at java.base/java.lang.Long.parseLong(Unknown Source)at java.base/java.util.stream.ReferencePipeline$5$1.accept(Unknown Source)at java.base/java.util.Iterator.forEachRemaining(Unknown Source)at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(Unknown Source)at java.base/java.util.stream.LongPipeline.toArray(Unknown Source)at com.google.devtools.build.lib.profiler.SystemNetworkStatsServiceImpl.getNetIoCountersLinux(SystemNetworkStatsServiceImpl.java:64)at com.google.devtools.build.lib.profiler.SystemNetworkStatsServiceImpl.getNetIoCounters(SystemNetworkStatsServiceImpl.java:43)at com.google.devtools.build.lib.profiler.NetworkMetricsCollector.collectSystemNetworkUsages(NetworkMetricsCollector.java:66)at com.google.devtools.build.lib.profiler.CollectLocalResourceUsage$SystemNetworkUsageCollector.collect(CollectLocalResourceUsage.java:489)at com.google.devtools.build.lib.profiler.CollectLocalResourceUsage$Collector.run(CollectLocalResourceUsage.java:200)

This is likely because we're usingRDMA over Converged
Ethernet

which massively inflates the transfer stats.

These values are u64s in the kernel so we should respect that
https://github.com/torvalds/linux/blob/187d0801404f415f22c0b31531982c7ea97fa341/include/uapi/linux/if_link.h#L219-L228

We had some users have this logic fail because of huge values in`/proc/net/dev` like 10586847412485054478.```FATAL: bazel crashed due to an internal error. Printing stack trace:java.lang.NumberFormatException: For input string: "10586847412485054478"at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)at java.base/java.lang.Long.parseLong(Unknown Source)at java.base/java.lang.Long.parseLong(Unknown Source)at java.base/java.util.stream.ReferencePipeline$5$1.accept(Unknown Source)at java.base/java.util.Iterator.forEachRemaining(Unknown Source)at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(Unknown Source)at java.base/java.util.stream.LongPipeline.toArray(Unknown Source)at com.google.devtools.build.lib.profiler.SystemNetworkStatsServiceImpl.getNetIoCountersLinux(SystemNetworkStatsServiceImpl.java:64)at com.google.devtools.build.lib.profiler.SystemNetworkStatsServiceImpl.getNetIoCounters(SystemNetworkStatsServiceImpl.java:43)at com.google.devtools.build.lib.profiler.NetworkMetricsCollector.collectSystemNetworkUsages(NetworkMetricsCollector.java:66)at com.google.devtools.build.lib.profiler.CollectLocalResourceUsage$SystemNetworkUsageCollector.collect(CollectLocalResourceUsage.java:489)at com.google.devtools.build.lib.profiler.CollectLocalResourceUsage$Collector.run(CollectLocalResourceUsage.java:200)```This is likely because we're using [RDMA over ConvergedEthernet](https://en.wikipedia.org/wiki/RDMA_over_Converged_Ethernet)which massively inflates the transfer stats.These values are u64s in the kernel so we should respect thathttps://github.com/torvalds/linux/blob/187d0801404f415f22c0b31531982c7ea97fa341/include/uapi/linux/if_link.h#L219-L228
@keith
Copy link
MemberAuthor

cc@coeuvre

@github-actionsgithub-actionsbot added team-PerformanceIssues for Performance teams awaiting-reviewPR is awaiting review from an assigned reviewer labelsDec 12, 2025
Copy link

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Code Review

This pull request addresses aNumberFormatException caused by parsing large unsigned 64-bit integer values from/proc/net/dev. The fix, which involves switching fromLong.parseLong toLong.parseUnsignedLong, is correct and effectively resolves the crash. The change is well-contained and directly targets the root cause of the issue.

@keith
Copy link
MemberAuthor

was able to workaround with--experimental_collect_system_network_usage=false for now

@fmeum
Copy link
Collaborator

@bazel-io fork 9.0.0

bazel-io reacted with thumbs up emoji

Copy link
Contributor

@tjgqtjgq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think you also need to fixNetworkMetricsCollector.calcDelta to work correctly with negative values.

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

Reviewers

@tjgqtjgqtjgq requested changes

+1 more reviewer

@gemini-code-assistgemini-code-assist[bot]gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

awaiting-reviewPR is awaiting review from an assigned reviewerteam-PerformanceIssues for Performance teams

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@keith@fmeum@tjgq

[8]ページ先頭

©2009-2025 Movatter.jp