-
Notifications
You must be signed in to change notification settings - Fork 125
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
SDK doesn't populate Device cache on first run of device service #376
Comments
I've verified it works fine with device-simple, and I am looking into device-virtual |
it also works fine in device-modbus, moving this issue to device-virtual |
new issue opened in device-virtual-go |
@cloudxxx8, I discovered this with my new device-rest-go and confirmed it in device-virtual-go. I did't see this issue until updating to the latest version of the SDK. |
@lenny-intel ok, I will take more time on this by Monday. We have to fix issue before release. |
@cloudxxx8 , I just confirmed this issue also with device-random. After a clean start (i.e. no device,profile, etc in DB) I get following error when submitting GET to
Once I restarted device-random the GET works as expected. Interestingly, Note that I debugged this issue with the REST DS and found that the Device cache, and likely the Profile cache are no longer being populate on the first run of the service. |
@lenny-intel I think I'm running into a similar issue with some testing I'm doing today using device-virtual. When I run device-virtual for the first time, GET commands work just fine, but PUT commands (with proper json payload) return 400's with this payload:
Some logging from the device:
When I restart the device-random ds, the PUT command works just fine again. Clearing the database allows me to repro. |
still needs #381 |
fixed by #381 |
@cloudxxx8 , I just tested this fix using latest on master for the SDK and still have the same issue. go.mod file is using
|
Do you encounter this issue in both REST and Virtual? |
there is another issue needs to be fixed in virtual |
@cloudxxx8 , still see the issue in REST and Random. |
@cloudxxx8 , I comment on the latest for PR this about new issue created by that change. Also seeing this error message on first run (REST and Random) and still seeing the device not found issue with the latest changes. Error message from device-random on first clean run: Seeing same on REST DS. Looks like profiles are getting cached, but not devices. I will debug some more today. |
sorry, I am not sure the reason. We made the verification on virtual, simple, and random. |
@cloudxxx8 , @FelixTing , @weichou1229 , I have traced this change: 42d494f#diff-f1021e656b92dfcfce91344acd0292bcL71 Adding this line back fixes my issue. I will create a PR later today. |
…n run Added back call to cache.Devices().Add() in createDevice() closes #376 Signed-off-by: lenny <leonard.goodell@intel.com>
This ended up being issue with Core MetaData callback not working correctly because the mixed local (DS) and docker (core service) environment that I was testing in. Once I ran core service locally (make run), the callback worked and devices were added on first run. |
Using latest SDK from master (v0.0.0-20191015162939-14f308f7b3dc as of 10/16/2019) the SDK no longer populates the Device cache for new devices, i.e. when the device service first runs.
The Device cache is then populated properly when the device service is restarted.
Reproduce this issue by:
http://localhost:49995/api/v1/device/name/Random-Float-Device/RandomValue_Float32
.-This will result in error stating
Random-Float-Device not found
Restart the service and resend the GET results in expected result of
RandomValue_Float32
being generated.Note the Profile cache is probably not populated either.
The text was updated successfully, but these errors were encountered: