-
Notifications
You must be signed in to change notification settings - Fork 52
Description
Affiliation
MIT PSFC
Version(s) Affected
Found in alpha-7-157-0 but likely in other releases too
Platform(s)
Found on macOS Tahoe but applies to other platforms too
Installation Method(s)
Developer build
Describe the bug
The API for IDL is designed to have just a single active mdsip connection. For example, the mdsopen procedure does not accept a parameter specifying the connection ID (i.e., the socket= keyword). It instead calls the mdsvalue() function which in turn obtains the ID of the most recently established connection from the global system variable, !MDS_SOCKET.
The problem is that if a program issues multiple mdsconnect commands, the API will indeed establish multiple mdsip connections. In practical usage, having some bogus / unused connections on the stack doesn't cause any problems simply because users don't create that many connections. However, if a loop was used to create a new connection on each iteration, then the bogus connections might become an issue.
Ideally, the API for IDL would do what the API for C does, namely disconnect the current connection before creating a new connection. Doing sure ensures that there would be just one active connection and that prior unused connections are destroyed.
To Reproduce
To see that bogus connections are accumulating, one must use the debugger or debug print statements to examine the stack of connections. Examining the source code is also useful.
Expected behavior
The API for IDL should not allow multiple active connections. There should just be a single active connection, and all prior connections should be destroyed.
Screenshots
n/a
Additional context
Issue #2996 has an example of three active connections using the API for IDL.