-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat: Pubsub.SeenMessagesStrategy #9543
feat: Pubsub.SeenMessagesStrategy #9543
Conversation
go.mod
Outdated
@@ -1,5 +1,7 @@ | |||
module github.com/ipfs/kubo | |||
|
|||
replace github.com/libp2p/go-libp2p-pubsub => github.com/smrz2001/go-libp2p-pubsub v0.0.0-20230110155724-04bfcf58514f |
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.
FYSA I've pushed this change, so we can see if CI passes against last commit from libp2p/go-libp2p-pubsub#513
(It is late Friday so will do proper review on Monday)
@smrz2001 In the future, you can point at an arbitrary commit from your own fork via:
$ go mod edit -replace github.com/libp2p/go-libp2p-pubsub=github.com/smrz2001/go-libp2p-pubsub@04bfcf58514f59bddb650fec5b2edac018c8c406
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.
Thanks so much, @lidel!! I didn't know we could point to fork commits like that!
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'll fix any CI issues that come up.
Updated to latest Will check on the result tomorrow. |
libp2p/go-libp2p-pubsub#513 use last seen time cache implementation
@lidel, since @vyzo requested switching back to the original, "first seen" time cache implementation in the pubsub PR, I updated the I could also make this configurable if you suggest. Regardless, I think it would be best to default to the new implementation for I could also make it configurable in a follow up PR. Please let me know either way. |
c8f5d2a
to
609c31b
Compare
@lidel, I see the "context deadline timeout" failure on (my previous) flaky pubsub tests that you mentioned might get fixed via this PR. I'm going to try bumping the timeout to see if that helps. 1 second is probably too small. |
2bbcb26
to
5e33745
Compare
Bah, it failed even with the larger value (though it passed just before that with the same value) :( |
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 could also make this configurable if you suggest. Regardless, I think it would be best to default to the new implementation for kubo, even if configurable.
I could also make it configurable in a follow up PR. Please let me know either way.
Fine to change the default, but please include a configuration option in this PR – @vyzo makes a good point, there may be people who build things based on the old behavior
We should document the change in release notes, allowing them to switch back via optional configration option.
Let's make it future-proof, in case more advanced strategies will be added in the future.
Add *OptionalString
to config/pubsub.go, and docs/config.md
, something like:
+SeenExpirationStrategy *OptionalString `json:",omitempty"`
With last-observed
being the new implicit default and first-observed
being the old one (feel free to pick better names). 🙏
@lidel, I just pushed some updates to make the cache implementation configurable. I relied on the enum I added to the pubsub code and used an |
Ok, nvm, I changed it to a string. |
@smrz2001 : FYI that @lidel is going to prioritize the review here so that we can wrap this up today/tomorrow and do 0.18.1 tomorrow: #9579 . If you can please be quick on any responses that come from @lidel , that would be great. Thanks! @lidel : I assume we'll do a changelog addition. 0.18.1 changelog has been started in #9587 |
Thanks so much for the cleanup and tweaks, @lidel 🙏🏼 |
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.
* feat: expire messages from the cache based on last seen time * docs: Pubsub.SeenMessagesStrategy Ref. libp2p/go-libp2p-pubsub#513 Co-authored-by: Marcin Rataj <lidel@lidel.org>
This PR closes #9542 – attempts to apply the fix for libp2p/go-libp2p-pubsub#502 to
kubo
.Once an official pubsub release is available, this draft PR can be updated accordingly and marked ready for review.
cc @lidel @BigLep
Should also close #9554