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

#263 OCL loader should throw an exception upon failure #264

Merged
merged 4 commits into from
Mar 14, 2024

Conversation

mseaton
Copy link
Collaborator

@mseaton mseaton commented Mar 6, 2024

No description provided.

Copy link
Contributor

@mogoodrich mogoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at the underlying importer code, but assuming it works the way I expect, makes sense...

@mseaton
Copy link
Collaborator Author

mseaton commented Mar 7, 2024

@ibacher / @rbuisson this is something we would like to get merged pretty soon. Any feedback?

ImportService importService = Context.getService(ImportService.class);

Import lastImport = importService.getLastImport();
log.debug("Starting OCL importer");
importer.run(zip);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will never throw an exception back here, so we need to inspect the ocl import table that OCL uses to report information, including errors, about the executed jobs. I've seen a few different scenarios:

  1. OCL fails to start an import at all, and so there is no ocl import entry written to the DB. This happens if, say, the server stopped during a previous import, and the previous import row was left with a null completion date. This will result in OCL logging stack traces to the console, but no row is written to the import table at all. So if the new import never started (no new row in the DB), we need to throw an exception here.

  2. OCL starts, and reports an error in the import table. If we have a specific error, throw and exception with those details

  3. OCL doesn't complete successfully and no specific error is logged. Not sure when or if this would happen, but it would be an error case.

@mseaton
Copy link
Collaborator Author

mseaton commented Mar 13, 2024

@ibacher / @rbuisson / @mks-d - I have updated my PR here. Please review.

Copy link
Member

@rbuisson rbuisson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very much looks like this is needed. Approved.

@mseaton mseaton merged commit 583aee2 into mekomsolutions:master Mar 14, 2024
2 checks passed
@mseaton mseaton deleted the ISSUE-263 branch March 14, 2024 15:16
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 this pull request may close these issues.

OCL loader should throw an exception upon failure
3 participants