Skip to content

Commit

Permalink
Fix hypha RPC issue (#355)
Browse files Browse the repository at this point in the history
* bump version

* bump version
  • Loading branch information
oeway authored May 6, 2022
1 parent 94239c6 commit 580f0ab
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imjoy-rpc",
"version": "0.5.11",
"version": "0.5.12",
"description": "Remote procedure calls for ImJoy.",
"module": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion python/imjoy_rpc/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.5.11"
"version": "0.5.12"
}
20 changes: 13 additions & 7 deletions python/imjoy_rpc/hypha/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,13 +907,19 @@ async def heartbeat(interval):
await promise["heartbeat"]()
except asyncio.CancelledError:
break
except Exception: # pylint: disable=broad-except
if method_task and not method_task.done():
logger.error(
"Failed to reset the heartbeat timer: %s",
data["method"],
)
method_task.cancel()
except Exception as exp: # pylint: disable=broad-except
logger.error(
"Failed to reset the heartbeat timer: %s, error: %s",
data["method"],
exp,
)
# TODO: We need more investigation here
# If the method task is cancelled
# It put the entire RPC in a bad state that can never recover
# if method_task and not method_task.done():
# method_task.cancel()
# break
if method_task and not method_task.done():
break
await asyncio.sleep(interval)

Expand Down

0 comments on commit 580f0ab

Please sign in to comment.