1
0

[MINOR] Prevent async service from starting twice (#4801)

This commit is contained in:
Raymond Xu
2022-02-14 11:06:31 -08:00
committed by GitHub
parent 0db1e978c6
commit bcfd8efe66

View File

@@ -125,6 +125,10 @@ public abstract class HoodieAsyncService implements Serializable {
* @param onShutdownCallback
*/
public void start(Function<Boolean, Boolean> onShutdownCallback) {
if (started) {
LOG.warn("The async service already started.");
return;
}
Pair<CompletableFuture, ExecutorService> res = startService();
future = res.getKey();
executor = res.getValue();