File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
yarn/src/main/scala/org/apache/spark/deploy/yarn Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -213,14 +213,18 @@ private[yarn] class YarnAllocator(
213213 amClient.addContainerRequest(request)
214214 val nodes = request.getNodes
215215 val hostStr = if (nodes == null || nodes.isEmpty) " Any" else nodes.last
216- logInfo(" Container request (host: %s , capability: %s) " .format(hostStr, resource))
216+ logInfo(s " Container request (host: $hostStr , capability: $ resource) " )
217217 }
218218 } else if (missing < 0 ) {
219219 val numToCancel = math.min(numPendingAllocate, - missing)
220- logInfo(s " Canceling requests for ${ numToCancel} executor containers " )
220+ logInfo(s " Canceling requests for $numToCancel executor containers " )
221221
222222 val matchingRequests = amClient.getMatchingRequests(RM_REQUEST_PRIORITY , ANY_HOST , resource)
223- matchingRequests.head.take(numToCancel).foreach(amClient.removeContainerRequest(_))
223+ if (! matchingRequests.isEmpty) {
224+ matchingRequests.head.take(numToCancel).foreach(amClient.removeContainerRequest)
225+ } else {
226+ logWarning(" Expected to find pending requests, but found none." )
227+ }
224228 }
225229 }
226230
You can’t perform that action at this time.
0 commit comments