-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat!: Synchronize autoevent start and stop operation to prevent fatal segmentation faults in device services #444
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of things on this so far -
- For the
sem_init
calls I'd rather see things like that in an__attribute__((constructor))
function - We should avoid master/slave terminology
- Should we have one 'slv' lock per device? ie make it part of the autoimpl structure?
- Do these extra synchronisations remove the need for the refcount in the autoimpl?
@iain-anderson Thanks for the review... Below are the responses:
|
I mean, like this:
and similarly a destructor funtion for the cleanup. Or, add the sem_init/sem_destroy calls to the service startup/stop sequences.
eg. primary/secondary, global/local, group/element Further thought - can this locking be achieved with plain mutexes rather than semaphores? |
BREAKING CHANGE: The concept is to have a proper synchronization mechanism using two level semaphores for device autoevents stop and start operation whenever there is some device profile update... This mechanism prevents the chances of segmentation faults in device services which actually results to device service start failure and instability...
Signed-off-by: Tuhin Dasgupta [email protected]
If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/device-sdk-c/blob/main/.github/Contributing.md
PR Checklist
Please check if your PR fulfills the following requirements:
BREAKING CHANGE:
describing the break)Testing Instructions
New Dependency Instructions (If applicable)