Spdk/examples/nvme/hotplug
Krzysztof Karas 91b8f349fd hotplug: let device insertions/removals take priority
When running io_loop() let insertions and removals counters
take precedence before timeouts. This will let us determine
the cause of premature io_loop() exit in case of timeout.

Consider two scenarios:
First:
 1. Hotplug app records enough insertions/removals
 2. During "if (now > tsc_end)" check it also notices that
    it should terminate due to time constraint
 3. Hotplug exits using the timeout condition, because
    enough time has passed and no error is printed at
    this point.

Second:
 1. Hotplug app did not record enough insertions/removals
    during app runtime
 2. During "if (now > tsc_end)" check it also notices that
    it should terminate due to time constraint
 3. Hotplug exits using the timeout condition, because
    enough time has passed and no error is printed at
    this point.

After prioritizing the check on counters we avoid the first
scenario and timeout will be checked after the counters
were confirmed to be less than expected value, allowing us
to determine the cause of failure earlier.

Additionally added an errorlog to the body of the if checking
for timeout to signal this failure.

First part of the series fixing #2201.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I3f6f9c5c95e82e0a003419fcf181d858ffbd94dd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15964
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-01-09 11:16:50 +00:00
..
.gitignore Add missing .gitignore files for binaries 2016-12-06 09:51:00 -07:00
hotplug_plugin.py Add SPDX header to various files 2022-11-29 08:27:51 +00:00
hotplug.c hotplug: let device insertions/removals take priority 2023-01-09 11:16:50 +00:00
Makefile update Intel copyright notices 2022-11-10 08:28:53 +00:00