mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-27 02:16:18 +00:00
MINOR: Fix Create Ingestion when finding an ingestion already (#20243)
* Fix Create Ingestion when finding an ingestion already * Add some backoff wait when retrieving pipeline status * Fix exception
This commit is contained in:
parent
b727f76ce4
commit
312a6dfbdd
@ -170,7 +170,7 @@ public class CreateIngestionPipelineImpl {
|
||||
JsonUtils.readOrConvertValue(ingestionPipelineStr, IngestionPipeline.class);
|
||||
if (ingestionPipeline.getPipelineType().equals(pipelineType)
|
||||
&& ingestionPipeline.getDisplayName().equals(displayName)) {
|
||||
return ingestionPipeline;
|
||||
return ingestionPipeline.withService(service.getEntityReference());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -90,6 +90,7 @@ public class RunIngestionPipelineImpl {
|
||||
IngestionPipeline ingestionPipeline,
|
||||
long startTime,
|
||||
long timeoutMillis) {
|
||||
long backoffMillis = 5 * 1000;
|
||||
while (true) {
|
||||
if (System.currentTimeMillis() - startTime > timeoutMillis) {
|
||||
return false;
|
||||
@ -102,7 +103,14 @@ public class RunIngestionPipelineImpl {
|
||||
.getData();
|
||||
|
||||
if (statuses.isEmpty()) {
|
||||
try {
|
||||
Thread.sleep(backoffMillis);
|
||||
backoffMillis *= 2;
|
||||
continue;
|
||||
} catch (InterruptedException ie) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new RuntimeException("Retry interrupted", ie);
|
||||
}
|
||||
}
|
||||
|
||||
PipelineStatus status = statuses.get(statuses.size() - 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user