You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mechanism for managing inline command concurrency in inventory collection #9935
Every time an inventory collection is triggered, a series of inline requests is made to collect system information. An inventory collection does not finish until every request has returned. This causes a problem if one of the requests hangs indefinitely. We've already seen this behaviour with zpool list, so it is not a hypothetical problem. Additionally, repeated inventory collection requests could bog down the system.
A proposed solution is to ensure at most one of the same command to retrieve information (e.g. zpool list) is running at any given time. This means if there is an outstanding process, there will be no new forks. New commands will queue up until the previous one is finished, we will introduce timeouts and report if some of the information was unable to be collected.
Every time an inventory collection is triggered, a series of inline requests is made to collect system information. An inventory collection does not finish until every request has returned. This causes a problem if one of the requests hangs indefinitely. We've already seen this behaviour with zpool list, so it is not a hypothetical problem. Additionally, repeated inventory collection requests could bog down the system.
Maybe this is implied, but I think this is specifically talking about sled-agent's inventory dropshot handler, right? Not inventory collection as a whole, which may talk to many sleds or other components (potentially concurrently, although most things are serial today).
A proposed solution is to ensure at most one of the same command to retrieve information (e.g. zpool list) is running at any given time. This means if there is an outstanding process, there will be no new forks. New commands will queue up until the previous one is finished, we will introduce timeouts and report if some of the information was unable to be collected.
I think one detail still to be ironed out is whether it's one zpool list to fetch all zpools, or one per expected zpool, or some combination. If it's one singular zpool list, that could hang if any disk is misbehaving. But per-disk subprocesses require us to know what zpools ought to exist, which maybe omits any unexpected / unmanaged ones. If we end up with any of the "one zpool list per disk" flavors, I think we'd want to allow at most one per disk to be running at a time (so any one hung one doesn't prevent successful collection from the remainder).
Maybe this is implied, but I think this is specifically talking about sled-agent's inventory dropshot handler, right? Not inventory collection as a whole, which may talk to many sleds or other components (potentially concurrently, although most things are serial today).
My understanding is that the inventory collection won't finish until it receives the information from all sleds no? Or am I misunderstanding?
I think one detail still to be ironed out is whether it's one zpool list to fetch all zpools, or one per expected zpool, or some combination. If it's one singular zpool list, that could hang if any disk is misbehaving. But per-disk subprocesses require us to know what zpools ought to exist, which maybe omits any unexpected / unmanaged ones. If we end up with any of the "one zpool list per disk" flavors, I think we'd want to allow at most one per disk to be running at a time (so any one hung one doesn't prevent successful collection from the remainder).
Running zpool list per disk does have the advantage of at least gathering some data in the event of a hung zpool list on a single disk. I'm not convinced we should take this approach. Wouldn't we want to know exactly what zpools are there even if we don't expect them? Is the complexity of adding a mechanism to know which zpools we expect to be there worth it?
My understanding is that the inventory collection won't finish until it receives the information from all sleds no? Or am I misunderstanding?
That's correct but I don't think it's really relevant to this issue, which is about how sled-agent's endpoint should behave, right?
Wouldn't we want to know exactly what zpools are there even if we don't expect them?
Yeah agreed, but I'm not sure how to balance that against not getting any information from any zpools if one is hanging. This would be Even More Implementation Complexity, but I could imagine something like:
independent zpool list for all known/expected zpools, so we know we'll get any information from any expected pool that isn't hanging
a blanket zpool list that can identify any other zpools, assuming none hang
Is the complexity of adding a mechanism to know which zpools we expect to be there worth it?
No new mechanism required - we already know which zpools are supposed to be there, because it's part of the config we already reconcile, and we already expose it in various ways; e.g., so new propolis zones can pick a random in-service zpool to host their root filesystem.
Yeah agreed, but I'm not sure how to balance that against not getting any information from any zpools if one is hanging. This would be Even More Implementation Complexity, but I could imagine something like:
independent zpool list for all known/expected zpools, so we know we'll get any information from any expected pool that isn't hanging
a blanket zpool list that can identify any other zpools, assuming none hang
Taking a look again. I wonder if we're going a bit too much in the weeds for the zpool list scenario. What we want here is a mechanism for managing inline command concurrency. We use zpool listas the example, but we'll want to use this mechanism for other commands as well.
Today we only list zpools based on the reconciled config yes? Also, as far as I know the health checks wouldn't take into consideration an unexpected zpool that is in a failed/unhealthy state.
Would it make sense to open up a separate issue to include the blanket zpool list to the inventory collection, but not necessarily as part of the work on this issue?
Let's leave these together for now under the banner of "collection of zpool inventory ought to be more resilient to zpool list hangs". The specific mechanism here (at most one command at a time) is part of that, as is running separate commands for each pool, as is including an extra zpool list to spot any other pools.
Activity
karencfv commentedon Feb 27, 2026
@davepacheco let me know if I missed something!
jgallagher commentedon Feb 27, 2026
Maybe this is implied, but I think this is specifically talking about sled-agent's inventory dropshot handler, right? Not inventory collection as a whole, which may talk to many sleds or other components (potentially concurrently, although most things are serial today).
I think one detail still to be ironed out is whether it's one
zpool listto fetch all zpools, or one per expected zpool, or some combination. If it's one singularzpool list, that could hang if any disk is misbehaving. But per-disk subprocesses require us to know what zpools ought to exist, which maybe omits any unexpected / unmanaged ones. If we end up with any of the "onezpool listper disk" flavors, I think we'd want to allow at most one per disk to be running at a time (so any one hung one doesn't prevent successful collection from the remainder).karencfv commentedon Feb 27, 2026
My understanding is that the inventory collection won't finish until it receives the information from all sleds no? Or am I misunderstanding?
Running
zpool listper disk does have the advantage of at least gathering some data in the event of a hungzpool liston a single disk. I'm not convinced we should take this approach. Wouldn't we want to know exactly what zpools are there even if we don't expect them? Is the complexity of adding a mechanism to know which zpools we expect to be there worth it?jgallagher commentedon Feb 27, 2026
That's correct but I don't think it's really relevant to this issue, which is about how sled-agent's endpoint should behave, right?
Yeah agreed, but I'm not sure how to balance that against not getting any information from any zpools if one is hanging. This would be Even More Implementation Complexity, but I could imagine something like:
zpool listfor all known/expected zpools, so we know we'll get any information from any expected pool that isn't hangingzpool listthat can identify any other zpools, assuming none hangNo new mechanism required - we already know which zpools are supposed to be there, because it's part of the config we already reconcile, and we already expose it in various ways; e.g., so new propolis zones can pick a random in-service zpool to host their root filesystem.
karencfv commentedon Mar 2, 2026
Taking a look again. I wonder if we're going a bit too much in the weeds for the
zpool listscenario. What we want here is a mechanism for managing inline command concurrency. We usezpool listas the example, but we'll want to use this mechanism for other commands as well.Today we only list zpools based on the reconciled config yes? Also, as far as I know the health checks wouldn't take into consideration an unexpected zpool that is in a failed/unhealthy state.
Would it make sense to open up a separate issue to include the blanket
zpool listto the inventory collection, but not necessarily as part of the work on this issue?davepacheco commentedon Mar 2, 2026
Let's leave these together for now under the banner of "collection of zpool inventory ought to be more resilient to
zpool listhangs". The specific mechanism here (at most one command at a time) is part of that, as is running separate commands for each pool, as is including an extrazpool listto spot any other pools.