-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup After Init behavior should better match MeasurementLink workflow #417
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pbirkhol-ni
changed the title
Cleanup After Init behavior should better match MeasurementLink workflow
Draft: Cleanup After Init behavior should better match MeasurementLink workflow
Nov 30, 2023
pbirkhol-ni
changed the title
Draft: Cleanup After Init behavior should better match MeasurementLink workflow
RFC: Cleanup After Init behavior should better match MeasurementLink workflow
Dec 1, 2023
jasonmreding
reviewed
Dec 4, 2023
...e/MeasurementLink Session Management/Session Reservation/Clear Error For Attach and Close.vi
Show resolved
Hide resolved
jasonmreding
approved these changes
Dec 4, 2023
pbirkhol-ni
changed the title
RFC: Cleanup After Init behavior should better match MeasurementLink workflow
Cleanup After Init behavior should better match MeasurementLink workflow
Dec 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this Pull Request accomplish?
#418
ISessionFactory
has an optional override calledClean Up After Init Error.vi
. Historically, this VI has attempted to put the grpc-device server back into the same state it was in before initialize was called. However, this can cause issues with the MeasurementLink workflow. For example, during ProcessCleanup, we initialize sessions with Attach and Close. If that step fails, we still want those sessions to be closed. However, the current behavior would leave those sessions open on the grpc-device server. This would cause rerunning the TestStand sequence to fail when creating the sessions. This PR attempts to fix this workflow, although I think some of the decisions I made will be controversial.Below are the behaviors that I added to this PR:
Init and Close
: On error, don't initialize any more sessions. Call close to clean up any sessions that had been created before the error.Init and Detach
: On error, don't initialize any more sessions. Call close to clean up any sessions that had been created before the error.Attach and Detach
: On error, don't attach to any more sessions. Call detach to clean up any sessions that had been attached before the error.Attach and Close
: On error, keep trying to attach to sessions. Once we have tried to attach to all sessions, call close on any sessions that were successfully attached.The
Init and Close
andAttach and Detach
behaviors aren't controversial. I also don't thinkInit and Detach
is too controversial. Rather than detaching, we are closing the sessions so that the instruments are in the same state as before we called Initialize.For
Attach and Close
, I modifiedInitialize Sessions Impl.vi
such that we try to attach to the session even if a previous attach had failed. This gives us the best chance at successfully cleaning up all sessions so that when we run again it doesn't fail because the session still exists on the grpc-device server. However, it could lead to issues where all sessions fail to Attach and so it takes a long time to fail.What testing has been done?
Automated tests. I modified some existing automated tests rather than write new ones. We already had existing automated tests for the various init/close behaviors. I just added more sessions to these tests to verify that in the
Attach and Close
case that we try to attach to all sessions, even after failure.