Struct DatabaseLockFile.LockInfo
Who holds a database, and whether they are willing to step aside.
public readonly struct DatabaseLockFile.LockInfo : IEquatable<DatabaseLockFile.LockInfo>
- Implements
- Inherited Members
Remarks
Why the profiler endpoint rides here. An observer that has the database — the Workbench opening a bundle its holder is using — knows who holds it but not where to watch it. The holder knows its own live port. This file is the one thing they already share, so the link is drawn database → engine, which is the direction the user arrives from. Putting the database's identity on the profiler's wire instead would answer the same question backwards, and would cost a wire-format change.
It is an advertisement of intent, not a liveness proof: the lock is written when the database opens, which may precede the listener actually binding. A consumer must treat a refused connect as "not watchable right now" rather than as a contradiction.
Constructors
LockInfo(int, string, DateTimeOffset, bool, string)
Who holds a database, and whether they are willing to step aside.
public LockInfo(int Pid, string MachineName, DateTimeOffset StartedAt, bool Yieldable, string ProfilerEndpoint)
Parameters
PidintProcess id of the holder.
MachineNamestringMachine the holder runs on. A different machine cannot be probed for liveness.
StartedAtDateTimeOffsetWhen the holder acquired the database.
Yieldablebooltrueonly when the holder explicitly advertised it. Absent means false, so a lock written by an older build — or by any normal engine — is never mistaken for one that will release on request.ProfilerEndpointstringWhere the holder's live profiler can be reached (
host:port), ornullwhen it runs without one. Absent means null, on the same reasoning asYieldable: a lock from an older build must never be read as offering something it does not have.
Remarks
Why the profiler endpoint rides here. An observer that has the database — the Workbench opening a bundle its holder is using — knows who holds it but not where to watch it. The holder knows its own live port. This file is the one thing they already share, so the link is drawn database → engine, which is the direction the user arrives from. Putting the database's identity on the profiler's wire instead would answer the same question backwards, and would cost a wire-format change.
It is an advertisement of intent, not a liveness proof: the lock is written when the database opens, which may precede the listener actually binding. A consumer must treat a refused connect as "not watchable right now" rather than as a contradiction.
Properties
MachineName
Machine the holder runs on. A different machine cannot be probed for liveness.
public string MachineName { get; init; }
Property Value
Pid
Process id of the holder.
public int Pid { get; init; }
Property Value
ProfilerEndpoint
Where the holder's live profiler can be reached (host:port), or null when it runs without one.
Absent means null, on the same reasoning as Yieldable: a lock from an older build must
never be read as offering something it does not have.
public string ProfilerEndpoint { get; init; }
Property Value
StartedAt
When the holder acquired the database.
public DateTimeOffset StartedAt { get; init; }
Property Value
Yieldable
true only when the holder explicitly advertised it. Absent means false, so a lock written by an
older build — or by any normal engine — is never mistaken for one that will release on request.
public bool Yieldable { get; init; }
Property Value
Methods
Deconstruct(out int, out string, out DateTimeOffset, out bool, out string)
public void Deconstruct(out int Pid, out string MachineName, out DateTimeOffset StartedAt, out bool Yieldable, out string ProfilerEndpoint)
Parameters
PidintMachineNamestringStartedAtDateTimeOffsetYieldableboolProfilerEndpointstring
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
Equals(LockInfo)
public bool Equals(DatabaseLockFile.LockInfo other)
Parameters
otherDatabaseLockFile.LockInfo
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(LockInfo, LockInfo)
public static bool operator ==(DatabaseLockFile.LockInfo left, DatabaseLockFile.LockInfo right)
Parameters
leftDatabaseLockFile.LockInforightDatabaseLockFile.LockInfo
Returns
operator !=(LockInfo, LockInfo)
public static bool operator !=(DatabaseLockFile.LockInfo left, DatabaseLockFile.LockInfo right)
Parameters
leftDatabaseLockFile.LockInforightDatabaseLockFile.LockInfo