Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CELEBORN-1787] Fix netty memory metrics was not registered when enable memory allocator share #3007

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,27 +148,30 @@ public static PooledByteBufAllocator getPooledByteBufAllocator(

public static PooledByteBufAllocator getPooledByteBufAllocator(
TransportConf conf, AbstractSource source, boolean allowCache, int coreNum) {
PooledByteBufAllocator allocator;
if (conf.getCelebornConf().networkShareMemoryAllocator()) {
return getSharedPooledByteBufAllocator(
conf.getCelebornConf(),
source,
allowCache && conf.getCelebornConf().networkMemoryAllocatorAllowCache());
}
int arenas;
if (coreNum != 0) {
arenas = coreNum;
allocator =
getSharedPooledByteBufAllocator(
conf.getCelebornConf(),
source,
allowCache && conf.getCelebornConf().networkMemoryAllocatorAllowCache());
} else {
arenas = conf.getCelebornConf().networkAllocatorArenas();
int arenas;
if (coreNum != 0) {
arenas = coreNum;
} else {
arenas = conf.getCelebornConf().networkAllocatorArenas();
}
allocator = createPooledByteBufAllocator(conf.preferDirectBufs(), allowCache, arenas);
}
PooledByteBufAllocator allocator =
createPooledByteBufAllocator(conf.preferDirectBufs(), allowCache, arenas);
if (source != null) {
String poolName = "default-netty-pool";
String poolName;
Map<String, String> labels = new HashMap<>();
String moduleName = conf.getModuleName();
if (!moduleName.isEmpty()) {
poolName = moduleName;
int index = allocatorsIndex.compute(moduleName, (k, v) -> v == null ? 0 : v + 1);
if (conf.getCelebornConf().networkMemoryAllocatorAllowCache()) {
poolName = allowCache ? "netty-shared-cache-pool" : "netty-shared-non-cache-pool";
Copy link
Member

Choose a reason for hiding this comment

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

given it also could be used on the client side, we'd better have celeborn- prefix in the name to distinguish with netty pools created by other components

Suggested change
poolName = allowCache ? "netty-shared-cache-pool" : "netty-shared-non-cache-pool";
poolName = allowCache ? "celeborn-netty-shared-cache-pool" : "celeborn-netty-shared-pool";

} else {
poolName = conf.getModuleName();
int index = allocatorsIndex.compute(poolName, (k, v) -> v == null ? 0 : v + 1);
labels.put("allocatorIndex", String.valueOf(index));
}
new NettyMemoryMetrics(
Expand Down
Loading