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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core Metadata] Handle plugged devices moving from one node to another node #4694

Open
lenny-goodell opened this issue Sep 26, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@lenny-goodell
Copy link
Member

馃殌 Feature Request

Relevant Package [REQUIRED]

This feature request is for Core Metadata

Description [REQUIRED]

Unable to successfully add device for USB camera when the camera is unplugged from Node A and plugged into Node B. Device USB Camera on Node B will get an error attempting to add the device for the camera when it discovers it. This is because a device with that name already exists in Core Metadata and is owned by Device USB Camera on Node A. i.e. the device doesn't get deleted when the camera is unplugged from Node A.

This issue is applicable to any devices that are plugged in and can be removed and plugged into a different node.

Describe the solution you'd like

One possible solution would be to add the `force` option on the Add Device Request and for the Device SDK to set this to `true` when adding devices that are auto provisioned.

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?
@lenny-goodell lenny-goodell added the enhancement New feature or request label Sep 26, 2023
@cloudxxx8
Copy link
Member

I think this feasture should be handled by the individual Device Service. If it detects any device is un-plugged, it can send a delete device request to core-metadata.

Also, we have implemented the update callback support to switch device service
#2716

@lenny-goodell
Copy link
Member Author

@cloudxxx8 , I agree that would be the best approach, but not all protocols notify when the device has been disconnected, The only way would be for the service to periodically (often) check if the device is still connected. Could be done as part of the discovery, but then discovery would have to be run often to detect removed device. I think this one is a good topic for Odessa planning.

@cloudxxx8
Copy link
Member

Since the old device service should also be notified, there are two approaches:

  1. In Device Service or SDK auto discovery logic, add device first, if it got conflict error code, execute update. The update API in core-metadata will send a callback to the old device service.
  2. In Core Metadata, implement a force add flag in Add Device API, and Core Metadata should call the Update function internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Release Backlog
Development

No branches or pull requests

2 participants