-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-30623][Core] Spark external shuffle allow disable of separate event loop group #27665
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -316,7 +316,8 @@ public long maxChunksBeingTransferred() { | |||||||||||||
|
|
||||||||||||||
| /** | ||||||||||||||
| * Percentage of io.serverThreads used by netty to process ChunkFetchRequest. | ||||||||||||||
| * Shuffle server will use a separate EventLoopGroup to process ChunkFetchRequest messages. | ||||||||||||||
| * When the config `spark.shuffle.server.chunkFetchHandlerThreadsPercent` is set, | ||||||||||||||
| * shuffle server will use a separate EventLoopGroup to process ChunkFetchRequest messages. | ||||||||||||||
| * Although when calling the async writeAndFlush on the underlying channel to send | ||||||||||||||
| * response back to client, the I/O on the channel is still being handled by | ||||||||||||||
| * {@link org.apache.spark.network.server.TransportServer}'s default EventLoopGroup | ||||||||||||||
|
|
@@ -339,12 +340,20 @@ public int chunkFetchHandlerThreads() { | |||||||||||||
| return 0; | ||||||||||||||
| } | ||||||||||||||
| int chunkFetchHandlerThreadsPercent = | ||||||||||||||
| conf.getInt("spark.shuffle.server.chunkFetchHandlerThreadsPercent", 100); | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's wrong with the previous code?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to give a default value here, when it comes to here, the config must be set.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because we only call this method if We will see exception if the assumption is broken.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this PR, we make the separate event loop group configurable by checking the config
Here the function spark/common/network-common/src/main/java/org/apache/spark/network/TransportContext.java Lines 124 to 129 in 0fe203e
Yes, this PR makes the feature disabled by default, let me also mention SPARK-25641 in PR description.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, @xuanyuanking and @cloud-fan . |
||||||||||||||
| Integer.parseInt(conf.get("spark.shuffle.server.chunkFetchHandlerThreadsPercent")); | ||||||||||||||
| int threads = | ||||||||||||||
| this.serverThreads() > 0 ? this.serverThreads() : 2 * NettyRuntime.availableProcessors(); | ||||||||||||||
| return (int) Math.ceil(threads * (chunkFetchHandlerThreadsPercent / 100.0)); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| /** | ||||||||||||||
| * Whether to use a separate EventLoopGroup to process ChunkFetchRequest messages, it is decided | ||||||||||||||
| * by the config `spark.shuffle.server.chunkFetchHandlerThreadsPercent` is set or not. | ||||||||||||||
| */ | ||||||||||||||
| public boolean separateChunkFetchRequest() { | ||||||||||||||
| return conf.getInt("spark.shuffle.server.chunkFetchHandlerThreadsPercent", 0) > 0; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| /** | ||||||||||||||
| * Whether to use the old protocol while doing the shuffle block fetching. | ||||||||||||||
| * It is only enabled while we need the compatibility in the scenario of new spark version | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ | |
| public class TransportRequestHandlerSuite { | ||
|
|
||
| @Test | ||
| public void handleStreamRequest() { | ||
| public void handleStreamRequest() throws Exception { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this change necessary?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, because of the changes for |
||
| RpcHandler rpcHandler = new NoOpRpcHandler(); | ||
| OneForOneStreamManager streamManager = (OneForOneStreamManager) (rpcHandler.getStreamManager()); | ||
| Channel channel = mock(Channel.class); | ||
|
|
@@ -66,7 +66,7 @@ public void handleStreamRequest() { | |
|
|
||
| TransportClient reverseClient = mock(TransportClient.class); | ||
| TransportRequestHandler requestHandler = new TransportRequestHandler(channel, reverseClient, | ||
| rpcHandler, 2L); | ||
| rpcHandler, 2L, null); | ||
|
|
||
| RequestMessage request0 = new StreamRequest(String.format("%d_%d", streamId, 0)); | ||
| requestHandler.handle(request0); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.