Skip to content
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

GH-1577 / Make processNewOrUpdatedSchema asynchronous #1579

Closed
lampajr opened this issue Apr 9, 2024 · 4 comments · Fixed by #1581
Closed

GH-1577 / Make processNewOrUpdatedSchema asynchronous #1579

lampajr opened this issue Apr 9, 2024 · 4 comments · Fixed by #1581
Assignees

Comments

@lampajr
Copy link
Member

lampajr commented Apr 9, 2024

Short term fix for of #1577

Feature idea.

Since fixing #1577 in the proper way could require some additional refactoring, that could have other implication, as short-term goal we decided to make the processNewOrUpdatedSchema

void processNewOrUpdatedSchema(SchemaDAO schema) {
// we don't have to care about races with new runs
findRunsWithUri(schema.uri, (runId, testId) -> {
log.debugf("Recalculate Datasets for run %d - schema %d (%s) changed", runId, schema.id, schema.uri);
onNewOrUpdatedSchemaForRun(runId, schema.id);
});
}

asynchronous, such that the creation/update of a Schema would become quite immediate and the run_schemas update (especially the FIND_RUNS_WITH_URI query execution) is handled asynchronously.

Describe the solution you'd like

Create a new channel to manage this new event type, on event receiving, trigger the processNewOrUpdatedSchema method.

Additional information

n/a

@lampajr lampajr changed the title Make processNewOrUpdatedSchema asynchronous GH-1577 / Make processNewOrUpdatedSchema asynchronous Apr 9, 2024
@lampajr
Copy link
Member Author

lampajr commented Apr 9, 2024

Worth to note that with this (temporary) approach we should stick with an increased transaction timeout (~120s) otherwise the FIND_RUNS_WITH_URI query will go in timeout even in the async process.

@lampajr lampajr self-assigned this Apr 9, 2024
@willr3
Copy link
Collaborator

willr3 commented Apr 9, 2024

This approach should also include some update to the UI so that the user knows the change is being processed in the background. There are parts of UI (e.g. assigning a run's schema) that relied on this being a synchronous operation.

@lampajr
Copy link
Member Author

lampajr commented Apr 9, 2024

This approach should also include some update to the UI so that the user knows the change is being processed in the background. There are parts of UI (e.g. assigning a run's schema) that relied on this being a synchronous operation.

Good point, since this is meant to be (hopefully) a temporary solution, do you think it would be enough to show a popup/warning/alert on schema save?

@willr3
Copy link
Collaborator

willr3 commented Apr 9, 2024

Something in the banner display or any other inline popup might work. I would avoid any use of alert or a modal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants