-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All-Queries-Endpoint fails on uninitialied queries #3570
Conversation
thoniTUB
commented
Sep 19, 2024
•
edited
Loading
edited
This is cause by the last release persisting execution states, which led to parts of the code assuming an execution was initialized. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sind nur unstimmigkeiten die aber nicht problematisch sind
backend/src/main/java/com/bakdata/conquery/models/forms/managed/ExternalExecution.java
Outdated
Show resolved
Hide resolved
@@ -525,7 +538,7 @@ public Stream<Map<String, String>> resolveEntities(Subject subject, List<FilterV | |||
throw new ConqueryError.ExecutionProcessingTimeoutError(); | |||
} | |||
|
|||
if (execution.getState() == ExecutionState.FAILED) { | |||
if (execution.getState(namespace.getExecutionManager()) == ExecutionState.FAILED) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wäre es nicht möglich den executionManager schon in der execution zu haben? Dann sparst du dir das wiederholte reingeben
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ist jetzt injected
final ExternalTaskState formState = state.getApi().getFormState(externalTaskId); | ||
|
||
updateStatus(formState, executionManager); | ||
Optional<ExternalState> state = this.executionManager.tryGetResult(this.getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
du verwendest hier this.executionManager obwohl du einen reingegeben bekommst. => bitte überarbeiten
backend/src/main/java/com/bakdata/conquery/models/query/DistributedExecutionManager.java
Show resolved
Hide resolved
if (!(state instanceof DistributedState distributedState)) { | ||
throw new IllegalStateException("Expected execution '%s' to be of type %s, but was %s".formatted(execution.getId(), DistributedState.class, state.getClass())); | ||
} | ||
distributedState.results.put(result.getWorkerId(), result.getResults()); | ||
|
||
// If all known workers have returned a result, the query is DONE. | ||
if (distributedState.allResultsArrived(getWorkerHandler(execution.getDataset().getId()).getAllWorkerIds())) { | ||
|
||
DistributedExecutionManager.DistributedState previousState = getResult(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicht benutzt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Habe ich auf geräumt, auch die nachfolgende Zeile war nicht mehr nötig
private static URI getPostQueryURI(StandaloneSupport conquery) { | ||
return HierarchyHelper.hierarchicalPath(conquery.defaultApiURIBuilder(), DatasetQueryResource.class, "postQuery") | ||
.buildFromMap(Map.of( | ||
"dataset", conquery.getDataset().getId() | ||
)); | ||
} | ||
|
||
private static URI getAllQueriesURI(StandaloneSupport conquery) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
|
||
assertThat(support.getMetaStorage().getAllExecutions().size()).as("Executions after restart").isEqualTo(numberOfExecutions); | ||
|
||
List<OverviewExecutionStatus> allQueries = IntegrationUtils.getAllQueries(support, 200); | ||
assertThat(allQueries).size().isEqualTo(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
…ove logging around faulty resultproviders
@awildturtok Danke, muss ich hier nochmal nacharbeiten? |