eclipse-agail / agile-core

Source code repository for agile core components
Eclipse Public License 2.0
7 stars 16 forks source link

instability when reading data #43

Open craigmulligan opened 7 years ago

craigmulligan commented 7 years ago

I've encountered some peculiarities when attempting to read from devices.

Case 1

Basically if you register a device and try read from it before it's registered, it throws an exception and then doesn't recover from. I've encountered this when running the UI.

The easiest way to test is run the agile-ui, register a device and then quickly navigate to the device page.

Case 2

If a device is registered (but not currently connected) and you issue a connection /devices/<id>/connection.

It then throws

agile-core_1  | Java HotSpot(TM) Client VM warning: You have loaded library /usr/src/app/deps/libunix-java.so which might have disabled stack guard. The VM will try to fix the stack guard now.
agile-core_1  | It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
agile-core_1  | Exception in thread "Sender" java.lang.NullPointerException
agile-core_1  |     at org.freedesktop.dbus.AbstractConnection$_sender.run(Unknown Source)
agile-core_1  | 15:32:35.699 [qtp22223153-19] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
agile-core_1  | org.freedesktop.dbus.exceptions.DBusExecutionException: Message Failed to Send: Broken pipe

In this case it's also unable to delete and re-register the device so have to restart the server.

 javax.ws.rs.WebApplicationException: Error on deleting device

I register the device and then try register and then subscribe instead of just reading from the device.

I've done a some testing and the only way I can get to work fairly reliably is to do:

  1. register the device
  2. subscribe via websocket
  3. read values via ws || lastUpdate.

As far as I know you should be able to do a single read without subscribing right?

Could someone clarify the possible work flows and expected behaviour for connecting and reading from a device?

craigmulligan commented 7 years ago

This was tested with a sensor tag.

rosogon commented 7 years ago

This also happens to me when reading from dummy device. And it is very likely to occur when you have a nodered workflow. I will post the exception next time it happens.

cskiraly commented 6 years ago

@rosogon Is this still happening? I think it was due to the D-Bus instability, already solved.

rosogon commented 6 years ago

I would say it is fixed, yes.