-
Notifications
You must be signed in to change notification settings - Fork 4
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
bugfix: nil dereference in FileApiLite::GetEpoch #408
Conversation
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.
what causes this? doesn't it make a real time
variable inside and &
it? how does it become nil
The caching layer can return a I wish I had kept better notes, I only remember for sure that I encountered a nil dereference error here in the wild. |
Ah, I've just had it happen again :) Whenever the internal RPC-calling func returns an error, the KVStore helper replaces the value with Where I encountered it was during shutdown (ctrl+C or k8s SIGTERM), because the RPC-based ConsensusApiLite gets closed mid-request. It should also happen in case of intermittent IO problems etc. |
but then err != nil and we'd bail before trying to dereference |
oh wait that link goes to a different function yeah |
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.
ok I never really looked into why GetFromCacheOrCall required it to be a pointer
62832f0
to
caf6b53
Compare
caf6b53
to
05d85fd
Compare
It probably technically doesn't, and we could return the default value instead. I used the pointer because functions in Go that return |
No description provided.