-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversation
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.
if (!db.isAvailable()) { | ||
userLog.warn( | ||
"Database %s not available, skipping apoc trigger cleanup of database %s.", | ||
db.databaseName(), dbName); | ||
return; | ||
} |
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.
We risk leaving triggers laying around for dropped databases. But what else can we do if system db is unavailable?
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.
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; |
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.
Should we even swallow this exception?
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.
Yeah, I think swallow it
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.
Makes sense, updated the PR to ignore this error.
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.
LGTM, I think swallowing would be fine (especially because triggers don't exist in Aura)