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

[EUtjTRHb] Better error handling and logging during cleanup of triggers #682

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

loveleif
Copy link
Contributor

@loveleif loveleif commented Nov 4, 2024

  • Add better logging when apoc fails to cleanup triggers during database drop.
  • Ignore trigger cleanup when system db is unavailable.

Comment on lines +178 to +183
if (!db.isAvailable()) {
userLog.warn(
"Database %s not available, skipping apoc trigger cleanup of database %s.",
db.databaseName(), dbName);
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We risk leaving triggers laying around for dropped databases. But what else can we do if system db is unavailable?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is reasonable, not much more we can do if the db is unavailable

} catch (Exception e) {
userLog.error(
"Failed to cleanup apoc triggers during database drop of %s: %s".formatted(dbName, e), e);
throw e;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we even swallow this exception?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think swallow it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, updated the PR to ignore this error.

Copy link
Contributor

@gem-neo4j gem-neo4j left a comment

Choose a reason for hiding this comment

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

LGTM, I think swallowing would be fine (especially because triggers don't exist in Aura)

@loveleif loveleif merged commit d8ffa0b into dev Nov 5, 2024
8 of 10 checks passed
@loveleif loveleif deleted the initializer-safety branch November 5, 2024 08:51
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.

2 participants