-
Notifications
You must be signed in to change notification settings - Fork 29k
[WIP][SPARK-30694][SHUFFLE]If exception occured while fetching blocks by ExternalBlockClient, fail early when External Shuffle Service is not alive #27419
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 3 commits
b9c3075
32d2be8
40dd076
c9061c5
2c4995e
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 |
|---|---|---|
|
|
@@ -103,14 +103,26 @@ public void fetchBlocks( | |
| try { | ||
| RetryingBlockFetcher.BlockFetchStarter blockFetchStarter = | ||
| (blockIds1, listener1) -> { | ||
|
|
||
| // Unless this client is closed. | ||
| if (clientFactory != null) { | ||
| TransportClient client = clientFactory.createClient(host, port); | ||
|
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. shall we only add try-catch to wrap this line?
Contributor
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.
It's OK to only wrap this line.
Contributor
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.
Updated, hope for review current change |
||
| TransportClient client = null; | ||
| try { | ||
| client = clientFactory.createClient(host, port); | ||
| } catch (Exception e) { | ||
|
||
| // throw ExternalShuffleServiceLostException exception then we won't retry to connect | ||
| // un-connected External Shuffle Service. | ||
| String msg = "The relative remote external shuffle service (host: " + host + "," + | ||
| "port: " + port + "), which maintains the block data can't been connected."; | ||
| logger.info(msg); | ||
| throw new ExternalShuffleServiceLostException(msg); | ||
| } | ||
| new OneForOneBlockFetcher(client, appId, execId, | ||
| blockIds1, listener1, conf, downloadFileManager).start(); | ||
| blockIds1, listener1, conf, downloadFileManager).start(); | ||
|
||
| } else { | ||
| logger.info("This clientFactory was closed. Skipping further block fetch retries."); | ||
| } | ||
|
|
||
|
||
| }; | ||
|
|
||
| int maxRetries = conf.maxIORetries(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.spark.network.shuffle; | ||
|
|
||
| /** | ||
| * Exception throw when we can't connect to external shuffle service to sto unnecessary | ||
| * retry in ExternalShuffleStoreClient.fetchBlocks() | ||
| */ | ||
| public class ExternalShuffleServiceLostException extends Exception { | ||
|
|
||
| ExternalShuffleServiceLostException(String message) { | ||
| super(message); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we revert this unnecessary line?