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

Panic appending nil reading on image 2.0.6 #64

Open
MatthewHink opened this issue Aug 12, 2020 · 1 comment
Open

Panic appending nil reading on image 2.0.6 #64

MatthewHink opened this issue Aug 12, 2020 · 1 comment
Assignees

Comments

@MatthewHink
Copy link
Contributor

As usual there are at least two issues here. First off we are getting no reading from the device for some reason. Second is that a plugin cannot currently append a nil reading to a read context in synse v3 as in v2.

The panic is happening here in the scheduler since rctx.Reading is nil there is no
rtcx.Reading.Value.
https://github.com/vapor-ware/synse-sdk/blob/daad6cb4f63a975772e0584783ca7c7e5e6823f6/sdk/scheduler.go#L487

Logs:

modbus-panic-logs.txt

TODO:

  • Tests for when a nil reading is added to a read context.
  • nil check reading in the scheduler.
  • Why are we not getting data from the device in the first place.
@MatthewHink MatthewHink self-assigned this Aug 12, 2020
@MatthewHink
Copy link
Contributor Author

Have test updates where we make and test for a reading with a nil value (nil reading is an error). We didn't get data from the vsm controller on the pass in the log. The command line tool is getting data right now, so it could be a blip.

Took a look in the scheduler and I don't think we will need the nil check mentioned above to get modbus up now.

I did see this in the scheduler where it looks like bulk read is done in parallel for each handler. https://github.com/vapor-ware/synse-sdk/blob/daad6cb4f63a975772e0584783ca7c7e5e6823f6/sdk/scheduler.go#L338-L347

This could be an issue because there will be parallel reads on read_only_coils/coils and read_only_holding_register/holding_register and the modbus devices may not be able to handle that load. For now my proposal is to try it out, and if it's a problem, that is the next thing to look at.

Going to get a patch together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant