Skip to content

A device's timeout_ms bounds no I/O; the Local backend always times out after 5 seconds #245

Description

@ShortArrow

A device's timeout_ms bounds no I/O. The only code that reads device.Timeout is the pool, which uses it to bound the wait for a device another session has leased (PoolingBackendFactory). No backend reads it.

  • Local backend (VISA runtime). LocalBackend.OpenAsync opens every session with _openTimeout, 5 seconds by default (L31), and VisaSessionFactory.Open sets the session's I/O timeout, TimeoutMilliseconds, to that same value. Every read and write through a VISA runtime therefore times out after 5 seconds, whatever timeout_ms says: a longer measurement always fails, and a shorter timeout meant to fail fast waits 5 seconds.
  • HiSLIP, VXI-11 and SOCKET backends. None of them references the device's timeout, and a search of src/ finds no CancelAfter on their query or read paths. How long a read waits for an instrument that never answers is then up to the transport and the caller's cancellation token; that needs measuring per backend.

Expected: timeout_ms bounds each read and write on every backend. visa add --timeout-ms and the Device record both describe it as the "per-device default operation timeout". Whether opening a session uses the same value or a bound of its own is worth deciding while fixing this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions