Skip to content
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

Gorse worker refreshCache panic. #608

Closed
binary4cat opened this issue Jan 6, 2023 · 3 comments · Fixed by #611
Closed

Gorse worker refreshCache panic. #608

binary4cat opened this issue Jan 6, 2023 · 3 comments · Fixed by #611
Labels
bug Something isn't working

Comments

@binary4cat
Copy link

Please answer these questions before submitting your issue. Thanks!

Gorse version

Version:         v0.4.10-4-g762f21f
API version:     v0.2.7
Go version:      go1.19.4
Git commit:      762f21f3154f35877fe376ba435c11e7eaaf5edc
Built:           Fri Jan  6 09:00:06 UTC 2023
OS/Arch:         linux/amd64

Describe the bug
In the worker, the LastUpdateUserRecommendTime (worker/worker.go:1120) data in the cache is read in the refreshCache (worker/worker.go:1117) function, but for unknown reasons, it is not found, resulting in an error, but the error handling only determines the error except for the not found case, resulting in the timeLimit (worker/worker.go:1118) not being initialized to always be nil, which leads to a panic in the RemSortedByScore (worker/worker.go:1150) delete method calling timeLimit.

Since I don't understand the process here, I'm not sure if the not found error should be returned, so I need your help!

This is what I found after using mongodb, and it was not found when using redis and mysql.

To Reproduce
Steps to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

@binary4cat binary4cat added the bug Something isn't working label Jan 6, 2023
@zhenghaoz zhenghaoz linked a pull request Jan 9, 2023 that will close this issue
@zhenghaoz
Copy link
Collaborator

Thanks for your feedback. What kinds of Mongo deployment do you use? Single node or cluster.

@binary4cat
Copy link
Author

binary4cat commented Jan 9, 2023

Thanks for your feedback. What kinds of Mongo deployment do you use? Single node or cluster.

Thanks for your work, I use a cluster with three nodes.

@zhenghaoz
Copy link
Collaborator

zhenghaoz commented Jan 9, 2023

Thanks for your feedback. What kinds of Mongo deployment do you use? Single node or cluster.

Thanks for your work, I use a cluster with three nodes.

It is caused by inconsistent read between nods. I will give a better fix tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants