Github user tdas commented on a diff in the pull request: https://github.com/apache/spark/pull/16220#discussion_r91647016 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/streaming/StreamingQueryManager.scala --- @@ -206,90 +287,70 @@ class StreamingQueryManager private[sql] (sparkSession: SparkSession) { recoverFromCheckpointLocation: Boolean = true, trigger: Trigger = ProcessingTime(0), triggerClock: Clock = new SystemClock()): StreamingQuery = { - activeQueriesLock.synchronized { - val name = userSpecifiedName match { - case Some(n) => - if (activeQueries.values.exists(_.name == userSpecifiedName.get)) { + // `queryName` and `queryId` will be set when we add them into `pendingQueryNames` and + // `pendingQueryIds` so that we can remove them at the end of this method when an error happens. + var queryName: String = null + var queryId: UUID = null + try { + userSpecifiedName.foreach { name => --- End diff -- Would be nice to add comment in each section, like "Make sure no other query with same name is active", "...query with same id...." , etc.
--- 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