-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
secrets/database: fixes external plugin reconnect after shutdown for v4 and v5 interface #12087
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
austingebauer
requested review from
pcman312,
calvn,
jasonodonnell,
fairclothjm,
MilenaHC,
vinay-gopalan and
a team
July 15, 2021 02:07
calvn
approved these changes
Jul 15, 2021
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.
Nice! We should backport this to 1.7x and 1.6.x as well.
benashz
approved these changes
Jul 15, 2021
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
fairclothjm
approved these changes
Jul 15, 2021
jasonodonnell
approved these changes
Jul 15, 2021
fairclothjm
approved these changes
Jul 15, 2021
austingebauer
changed the title
secrets/database: fixes external plugin reconnect after shutdown for v5 interface
secrets/database: fixes external plugin reconnect after shutdown for v4 and v5 interface
Jul 15, 2021
austingebauer
added a commit
that referenced
this pull request
Jul 15, 2021
…v4 and v5 interface (#12087) * secrets/database: fixes external plugin shutdown reconnect for v5 interface * adds changelog entry * fixes handling of plugin shutdown for password generation on v4 interface
austingebauer
added a commit
that referenced
this pull request
Jul 15, 2021
…v4 and v5 interface (#12087) * secrets/database: fixes external plugin shutdown reconnect for v5 interface * adds changelog entry * fixes handling of plugin shutdown for password generation on v4 interface
austingebauer
added a commit
that referenced
this pull request
Jul 15, 2021
…v4 and v5 interface (#12087) * secrets/database: fixes external plugin shutdown reconnect for v5 interface * adds changelog entry * fixes handling of plugin shutdown for password generation on v4 interface
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR fixes an issue that prevents external database plugin processes from restarting (via new process) after being killed. The CloseIfShutdown method was not deleting cached connections because
v5.ErrPluginShutdown
was not in the switch case. This resulted in indefiniteplugin shutdown
errors when trying to read credentials after a plugin process had been killed. This system behavior existed in the v4 interface and was depended on by customers.This PR also fixes handling of plugin shutdown for password generation using the v4 interface. If password generation failed with
v4.ErrPluginShutdown
, the cached connection was never deleted. This resulted in indefiniteunable to generate password: plugin shutdown
errors when trying to read credentials after a plugin process had been killed.Testing
v5 Shutdown
I verified that the plugin restarting behavior existed using Vault 1.5.x and vault-plugin-database-oracle 0.2.x (both on v4 interface). I reproduced the issue and tested the fix using Vault 1.6.x+ and vault-plugin-database-oracle 0.3.x+.
Manual testing output:
v4 Shutdown
I reproduced the issue and tested the fix using Vault 1.6.x+ (v5 interface) and vault-plugin-database-oracle 0.2.x (v4 interface).
Manual testing output: