-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
support concurrent-safe WriteSyncer #359
Conversation
@flisky, thanks for your PR! By analyzing the history of the files in this pull request, we identified @akshayjshah and @suyash to be potential reviewers. |
Travis errors with "Update failed for go.uber.org/atomic: Cannot detect VCS" Trigger again. |
The CI should pass. Please take a review. |
Any chance you could provide a sample program demonstrating usage for this feature? |
Actually, I need the lock to do an application-level log rotate, but zap doesn't expose the underlying |
@flisky I'm sorry, I'm still confused. Can you explain your use case in more detail? If you're trying to provide your own |
It calls the #106 said -
And this is a way trying to advise Is my understanding correct? Thanks! |
Oh dear, you're right - I was so sure that we'd already removed that. Let's fix this properly and just remove the automatic lock in The |
func TestLockedWriteSyncerInterface(t *testing.T) { | ||
buf := &bytes.Buffer{} | ||
ws := AddSync(buf) | ||
var lws WriteSyncer = &lockedWriteSyncer{ws: ws} |
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.
It'd be even better if the test uses a concrete type separately implemented from the internal lockedWriteSyncer
since, as I understand it, the entire point of this PR is to support external implementations (and avoid double-locking them).
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.
Yes, half part. It also makes sure the internal lockedWriteSyncer
is okay.
A separately implementation would be almost same as our default one, so I don't think it necessary.
Would some rewords help? Any thoughts?
Could you give me a final okay to get rid of If so, would we keep the |
We shouldn't get rid of |
Hi, what about this PR? It's a very useful. When will it be merged? |
#369 as you wish, @akshayjshah. |
Follows up #106