CodeConstruct / dbus-sensors

D-Bus configurable sensor scanning applications
Apache License 2.0
0 stars 3 forks source link

[enhancement] improve the closing mechanism for NVMeSubsystem #11

Open drakedog2008 opened 11 months ago

drakedog2008 commented 11 months ago

Detailed in https://gbmc-review.googlesource.com/c/dbus-sensors/+/14999/comment/d88462cb_b06e6af6/

drakedog2008 commented 11 months ago

quoted from the comment in gerrit review:

The flushOperations() cannot guarantee all NVMeMI tasks has been drained.

E.g. we have a recursive task A created by async timer.

task A will push a NVMeMi function call to worker thread.

task A has been enqueued in the immediate_exec_que of the timer but haven't been executed because the current code (nvme->flushOperations()) in currently in the io_context.