Skip to content
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

Improve the shutdown behavior #287

Merged
merged 1 commit into from
Sep 9, 2024
Merged

Improve the shutdown behavior #287

merged 1 commit into from
Sep 9, 2024

Conversation

jonnew
Copy link
Member

@jonnew jonnew commented Sep 4, 2024

  • This commit addresses two issues
  • The first is that if there was an exception setting block read or write sizes, contextConfiguration within ContextTask was not disposed. This lead to a deadlock that required the process to be restarted even if the offending parameter was changed.
  • When addressing this, I noticed that there may be a more general issue that is documented on line 314 of ContextTask. The general issue is that contextConfiguration must always be disposed, and there are (unlikely) ways that it might not be.
  • Additionally, I improved the error messages presented when a ReadSize or WriteSize exception occurred indicating what value the user needs to use.
  • The second issue was that when a hub was configured as a passthrough device, it was not reset to a stanard hub when acqusition was stopped. This could cause issues because the raw device used by passthroughs is a member of hub zero and could lead to huge required block read sizes even a headstage was no longer present. To address this, I simply returned an active disposable whose action is to reset the port to standard mode fro source.CoonfigureHost in ConfigurePortController, rather than Disposable.Empty, which did nothing.

- This commit addresses two issues
- The first is that if there was an exception setting block read or
  write sizes, contextConfiguration within ContextTask was not disposed.
  This lead to a deadlock that required the process to be restarted
  even if the offending parameter was changed.
- When addressing this, I noticed that there may be a more general issue
  that is documented on line 314 of ContextTask. The general issue is
  that contextConfiguration must always be disposed, and there are
  (unlikely) ways that it might not be.
- Additionally, I improved the error messages presented when a ReadSize
  or WriteSize exception occurred indicating what value the user needs
  to use.
- The second issue was that when a hub was configured as a passthrough
  device, it was not reset to a stanard hub when acqusition was stopped.
  This could cause issues because the raw device used by passthroughs is
  a member of hub zero and could lead to huge required block read sizes
  even a headstage was no longer present. To address this, I simply
  returned an active disposable whose action is to reset the port to
  standard mode fro source.CoonfigureHost in ConfigurePortController,
  rather than Disposable.Empty, which did nothing.
@jonnew jonnew requested review from glopesdev and bparks13 September 4, 2024 20:18
@jonnew jonnew added this to the 0.3.0 milestone Sep 4, 2024
Copy link
Member

@bparks13 bparks13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I'm assuming this has been tested and is working appropriately for both the Passthrough State and handling exceptions while creating the context.

@jonnew jonnew merged commit 00e7f98 into main Sep 9, 2024
7 checks passed
@jonnew jonnew deleted the shutdown-behavior branch September 9, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants