-
Notifications
You must be signed in to change notification settings - Fork 175
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
eth,pm: avoid watchPoolSizeChange nil pointer error #1833
Conversation
7355dff
to
b0fbfc8
Compare
Did you actually confirm that the contract binding is returning a nil value even when the error is nil? The nil pointer error in #1828 is being trigger in this line. I believe I think this indicates another problem - LocalSenderMonitor depends on state in TimeWatcher that might not be initialized yet. One way to address this particular problem could be to move the state initialization logic (such as this line) into the TimeWatcher constructor which is called synchronously before |
No but it could be possible if a ethereum client is used with potential non-default behaviour here I guess (or some erroneous code). You're probably right that a properly implemented client likely doesn't return So yeah a race condition is more likely to be the cause here. |
I think the contract binding implementation should guarantee that the |
023b229
to
0777ed9
Compare
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.
Looks pretty good. Just 2 minor comments.
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.
LGTM after squashing
362dd8e
to
4e3ab38
Compare
4e3ab38
to
3719aee
Compare
What does this pull request do? Explain your changes. (required)
This issue might be caused by an unexpected return value from the ETH provider.
The error is caused by the following expression
Both values are fetched from
TimeWatcher.GetTranscoderPoolSize()
The value of
TimeWatcher.transcoderPoolSize
is initialised on node startup and refetched from the ETH provider when events are received.The contract binding
BondingManagerSession.GetTranscoderPoolSize()
returns the followingreturn *(new(*big.Int)), err
.This means that even though the return value (a pointer) can't be nil because it is initialised , but value the pointer refers to can still be and this is what is returned. If for some reason there is a nil error and an unexpected value from the contract call a nil pointer could still occur.
Specific updates (required)
nil, nil
How did you test each of these updates (required)
Does this pull request close any open issues?
Fixes #1828
Checklist:
make
runs successfully./test.sh
pass