reaper: add support for a pre-delete hook#11
Open
yanniszark wants to merge 6 commits intoyosssi:masterfrom
Open
reaper: add support for a pre-delete hook#11yanniszark wants to merge 6 commits intoyosssi:masterfrom
yanniszark wants to merge 6 commits intoyosssi:masterfrom
Conversation
Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
c8c392e to
60e395d
Compare
Add reaper option for a PreDeleteFn. This function runs before an expired session is deleted. This provide the library user an extra hook to do additional work before deleting a session (e.g., revoke tokens to a remote endpoint). Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
60e395d to
7096405
Compare
Collaborator
|
Thanks for the PR. Is it ready for review? |
The load unit-test hanged indefinitely. Presumably, this is because of a deadlock caused by starting a write transaction inside a read transaction. From the boltdb docs: > Read-only transactions and read-write transactions should not depend on > one another and generally shouldn't be opened simultaneously in the > same goroutine. This can cause a deadlock as the read-write transaction > needs to periodically re-map the data file but it cannot do so while a > read-only transaction is open. In addition, the protobuf error message returned for a case of the load unit test seems to have changed, so amended to the latest text. Signed-off-by: Yannis Zarkadas <yanniszark@arrikto.com>
Author
|
@kjmrknsn thanks for the prompt response! |
Author
|
@kjmrknsn kind ping on this! The CI tests are not passing because they need a newer go version, but it seems that a box is not available. Not very familiar with wercker. How can we have a box with a later golang version? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
Resolves: #10
Changes organized in commits:
go mod init)PredeleteFnhook in reaper's options. Reaper will call thePredeleteFnwith the session values. If thePredeleteFnreturns an error, the key won't be deleted.The wercker test doesn't pass because of a very old go version I presume.
Is there any way to update the box? Using docker images doesn't seem to work (I specified
golang:1.14)