-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Affiliation
MIT PSFC
Version(s) Affected
Found in alpha-7-157-0 but surely in other versions too
Platform(s)
Found on macOS Tahoe but applies to all platforms
Installation Method(s)
Developer build
Describe the bug
The API for MATLAB is designed to have just a single active mdsip connection. The connection is managed by an object (Java or Python) stored in the global MDSINFO structure. However, if multiple mdsconnect() statements are executed, multiple connection objects are created -- but only the most recent one is accessible via the MDSINFO structure.
In normal usage, few connections are created thus there is little harm by having a few bogus connection objects hanging around. However, connection creation is done inside a loop, then the accumulated bogus connections could become a problem.
Ideally, the API for MATLAB would be similar to the API for C, namely it would disconnect the current connection before creating a new connection.
To Reproduce
Examine the source code. Also use a debugger or debug print statements to see how connections accumulate when multiple mdsconnect() statements are executed.
Expected behavior
Obsolete connections should be destroyed. There should only be one active connection at a time.
Screenshots
n/a
Additional context
This is related to a similar issue for IDL, #3004.