-
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
Hwp site changes #541
Hwp site changes #541
Conversation
updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](pre-commit/pre-commit-hooks@v4.4.0...v4.5.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ok to me for the most part, however I don't agree with the new _establish_connection
logic in the PID and PMX controllers. I think this needs to fail after a certain number of attempts, instead of entering an infinite loop.
# unit tests might fail on first connection attempt | ||
attempts = 3 | ||
for attempt in range(attempts): | ||
while True: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this being an infinite loop, since control is never passed back to the agent. Can we keep this to a finite number of attempts, and handle re-connection at the agent level?
if attempt == 1: | ||
print("Resetting connection") | ||
self.conn.close() | ||
self.conn = self._establish_connection(self.ip, int(self.port)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as mentioned above, if there is no connection, establish_connection
here will wait forever. Instead, this should throw an error after a finite amount of time.
Hi @bbixler500 , this fix looks great! Over at SATP3 we've been having trouble with our PID and gripper agents, and I've tested this branch and they work. I'd greatly appreciate getting this merged soon. |
At the site there was a strange behavior where the PID and PMX agents would consistently crash every night, requiring me to restart the agents every morning. These crashes occurred because of connection interruptions, which could last up to 3hrs (I was never able to determine the cause of the connection interruptions). Previously the agents were coded so that |
I think you can let the acq process be the "infinite loop" here: https://github.com/simonsobs/socs/blob/hwp_site_changes/socs/agents/hwp_pid/agent.py#L286 |
…f iterations. Added reconnection functionality into the agent acq process
for more information, see https://pre-commit.ci
@bbixler500 this change looks good to me. If you could fix the pytest failure and pre-commit failure, we can get this approved and merged. |
I'm not sure what this pytest error means or how to solve it. It appears to be from the |
@jlashner @BrianJKoopman can we get this reviewed and merged this week? SATP3 would like to spin the HWP this weekend. thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks for the changes @bbixler500
* minor bugfixes to the hwp-gripper agent * Modified hwp-pid and hwp-pmx agents to handle connection interruptions * [pre-commit.ci] pre-commit autoupdate (#540) updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](pre-commit/pre-commit-hooks@v4.4.0...v4.5.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Changed connection protocal from an infinite loop into a set number of iterations. Added reconnection functionality into the agent acq process * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixes to pre-commit failures * Added read=False to set_current_limit meathod --------- Co-authored-by: Bryce Bixler <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Changes to the hwp_gripper, hwp_pid, and hwp_pmx agents to improve functionality at the site
Description
Motivation and Context
As it is currently, the hwp_gripper agent does not work. The changes made to that agent were made to get it running. The hwp_pid and hwp_pmx agents crash if the network communication is temporarily lost. The changes made to those agents are to prevent that crashing.
How Has This Been Tested?
All three of these agents have been running on the dev environment overnight with no issue. The changes to the hwp_gripper agent are minor and only effect how the agent is initialized. The changes to the hwp_pid and hwp_pmx agents only change the socket communication between agent and device, and the agents have been continually sending data to grafana successfully.
Types of changes
Checklist: