GitHub user janplus opened a pull request: https://github.com/apache/spark/pull/18376
[SPARK-21161][CORE] Make the parseHostPort method tolerate non digital charactors ## What changes were proposed in this pull request? Fix the following port parse bug when querying Solr data. ``` 17/06/21 12:40:53 INFO ContextLauncher: 17/06/21 12:40:53 ERROR scheduler.DAGSchedulerEventProcessLoop: DAGSchedulerEventProcessLoop failed; shutting down SparkContext 17/06/21 12:40:53 INFO ContextLauncher: java.lang.NumberFormatException: For input string: â8983_solrâ 17/06/21 12:40:53 INFO ContextLauncher: at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) 17/06/21 12:40:53 INFO ContextLauncher: at java.lang.Integer.parseInt(Integer.java:580) 17/06/21 12:40:53 INFO ContextLauncher: at java.lang.Integer.parseInt(Integer.java:615) 17/06/21 12:40:53 INFO ContextLauncher: at scala.collection.immutable.StringLike$class.toInt(StringLike.scala:272) 17/06/21 12:40:53 INFO ContextLauncher: at scala.collection.immutable.StringOps.toInt(StringOps.scala:29) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.util.Utils$.parseHostPort(Utils.scala:959) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.cluster.YarnScheduler.getRackForHost(YarnScheduler.scala:36) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.TaskSetManager$$anonfun$org$apache$spark$scheduler$TaskSetManager$$addPendingTask$1.apply(TaskSetManager.scala:200) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.TaskSetManager$$anonfun$org$apache$spark$scheduler$TaskSetManager$$addPendingTask$1.apply(TaskSetManager.scala:181) 17/06/21 12:40:53 INFO ContextLauncher: at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) 17/06/21 12:40:53 INFO ContextLauncher: at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.TaskSetManager.org$apache$spark$scheduler$TaskSetManager$$addPendingTask(TaskSetManager.scala:181) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.TaskSetManager$$anonfun$1.apply$mcVI$sp(TaskSetManager.scala:160) 17/06/21 12:40:53 INFO ContextLauncher: at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.TaskSetManager.<init>(TaskSetManager.scala:159) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.TaskSchedulerImpl.createTaskSetManager(TaskSchedulerImpl.scala:212) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.TaskSchedulerImpl.submitTasks(TaskSchedulerImpl.scala:176) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.DAGScheduler.submitMissingTasks(DAGScheduler.scala:1043) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$submitStage(DAGScheduler.scala:918) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$submitStage$4.apply(DAGScheduler.scala:921) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.DAGScheduler$$anonfun$org$apache$spark$scheduler$DAGScheduler$$submitStage$4.apply(DAGScheduler.scala:920) 17/06/21 12:40:53 INFO ContextLauncher: at scala.collection.immutable.List.foreach(List.scala:381) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$submitStage(DAGScheduler.scala:920) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.DAGScheduler.handleJobSubmitted(DAGScheduler.scala:862) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:1613) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1605) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1594) 17/06/21 12:40:53 INFO ContextLauncher: at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:48) ``` ## How was this patch tested? Unit tests added. Also did integrated test with Solr. You can merge this pull request into a Git repository by running: $ git pull https://github.com/janplus/spark solr-port-bug-master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/18376.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #18376 ---- commit 2b62b6bd91dcbd77f91bee1b1a0d6e496a5b5219 Author: wujian <jan.chou...@gmail.com> Date: 2017-06-21T13:29:29Z [SPARK-21161][CORE] Make the parseHostPort method tolerate non digital charactors. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org