[DiskArbitration] Is it possible to get the state of a Session?

It does not seem to be documented but, according to the DiskArbitration source code from Darwin, if an approval callback does not return after 10 seconds, the session state is set to timeout and further approval callbacks are never called anymore.

Based on the source code, it does not seem possible but as I may be missing something:

[Q] Is there a way to get/set the state of a DASessionRef or DAApprovalSessionRef? Would there be some kind of notification mechanism to be informed that a session has been set as timed out?

Answered by DTS Engineer in 730492022

No, there isn't any mechanism to check the state here. You could infer what's happened from other callbacks, but there isn't any mechanism to directly check the status.

Having said that, it's hard for me to think of any reason why a client would need to stall the request for even 1s, much less 10s. Basically, you shouldn't be getting anywhere CLOSE to that timeout.

-Kevin Elliott

DTS Engineer, CoreOS/Hardware

Accepted Answer

No, there isn't any mechanism to check the state here. You could infer what's happened from other callbacks, but there isn't any mechanism to directly check the status.

Having said that, it's hard for me to think of any reason why a client would need to stall the request for even 1s, much less 10s. Basically, you shouldn't be getting anywhere CLOSE to that timeout.

-Kevin Elliott

DTS Engineer, CoreOS/Hardware

[DiskArbitration] Is it possible to get the state of a Session?
 
 
Q