Skip to content

Commit be03c3b

Browse files
shiyuhang0ti-chi-bot
authored andcommitted
optimize
1 parent f12d51a commit be03c3b

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

core/src/main/scala/com/pingcap/tispark/safepoint/ServiceSafePoint.scala

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,17 @@ case class ServiceSafePoint(
103103
}
104104

105105
def stopRegisterSafePoint(): Unit = {
106-
minStartTs = Long.MaxValue
107-
clientSession.getTiKVSession.getPDClient.updateServiceGCSafePoint(
108-
serviceId,
109-
ttl,
110-
Long.MaxValue,
111-
ConcreteBackOffer.newCustomBackOff(PD_UPDATE_SAFE_POINT_BACKOFF))
112-
service.shutdownNow()
106+
try {
107+
minStartTs = Long.MaxValue
108+
clientSession.getTiKVSession.getPDClient.updateServiceGCSafePoint(
109+
serviceId,
110+
ttl,
111+
Long.MaxValue,
112+
ConcreteBackOffer.newCustomBackOff(PD_UPDATE_SAFE_POINT_BACKOFF))
113+
} catch {
114+
case e: Exception => logger.error("Failed to stop register service GC safe point", e)
115+
} finally {
116+
service.shutdownNow()
117+
}
113118
}
114119
}

0 commit comments

Comments
 (0)