vapor-ware / synse-server

An HTTP API for monitoring and controlling physical and virtual devices
https://synse.readthedocs.io/en/latest/server/intro/
GNU General Public License v3.0
39 stars 11 forks source link

When has scan found all configured devices? #115

Closed MatthewHink closed 6 years ago

MatthewHink commented 6 years ago

Description

We used to get all devices on a scan.

Now we get partial scan results as the containers come up.

At least for testing purposes it would be good to know when / if scan has found all configured devices.

Would also simplify auto-fan which used to cache the scan results once it had them. Not it can't do that.

Related Issues

Close Criteria

Notes

edaniszewski commented 6 years ago

Synse Server can't guarantee that what the metainfo that the plugin is returning is the complete set of configured devices. It should be, since device config parsing at the plugin level should happen before the gRPC server is up, so if Synse Server can reach the plugin, device registration should be complete, but this doesn't account for bad configs, misconfiguration, etc.

Assuming that the plugin metainfo request will always return the complete set of device config info, then at the Synse Server level, we can add something (perhaps to the plugins endpoint) that says whether or not we've established communication with the plugin and issued commands to it.

One caveat is that the scan info in Synse Server is cached, so if we start synse server, get back a response from 3/4 configured plugins (maybe the 4th has a lot of devices and needs more time to register), then it will cache the 3/4. Subsequent scans/reads/etc will use that cache until (a) it reaches its TTL and is automatically invalidated and rebuilt, (b) it is manually invalidated and rebuilt.