-
Notifications
You must be signed in to change notification settings - Fork 18
fix(recovery): Change initialiseConnection() in XAResourceRecoveryHelper #34
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
base: master
Are you sure you want to change the base?
Conversation
- At least on Oracle & Postgres, the connections wrapped inside the XAConnections will automatically timeout after some time. - When it happens, the recovery mechanism does not detect that the XAConnections need to be closed & recreated (as the objects are not null). This will generate warning logs at regular intervals as the recovery mechanism tries to do its thing on "dead" connections. This commit improves this behavior by: - Attempting to properly close the "active" connection& - then always recreating a connection during the recovery process.
Can one of the admins verify this patch? If it is not dangerous to our systems, juts tell me to "run_tests". ( without the underscore and quotes 😃 ) |
} catch (Exception e) { | ||
log.debug("XAResourceRecoveryHelper : The connection could not close properly, generating a new one", e); | ||
} finally { | ||
connection = null; |
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.
So if I am reading this correctly then every call to getXAResources()
will return a fresh connection. I'm not sure who calls it, but I am assuming it is called by the narayana recovery module, which means that each recovery pass will get a fresh resource. I am unclear about the performance impact but safety is more important than performance. On this basis I will confer my approval.
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 you are right.
run_tests |
run tests |
1 similar comment
run tests |
@danila-m CI failed on
|
The CI job needed reconfiguration and it should be fine now. @zhfeng , if you comment run_tests without the underscore it will run again.... |
Done |
run tests |
@mmadzin @jfclere Could you take it from here, please?
(not related to this PR) The project needs some attention :-) |
Hello @Karm I still approve of this change. Will you either merge it or withdraw the PR.
Is there an issue for this problem? |
This commit improves this behavior by: