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

Multihomed transport (server) addrs 🕶️ #367

Draft
wants to merge 65 commits into
base: asyncio_debugger_support
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ee151b0
Mk `gather_contexts()` support `@acm`s yielding `None`
goodboy Sep 27, 2023
3d0e955
Init-support for "multi homed" transports
goodboy Sep 27, 2023
fa9a9cf
Kick off `.devx` subpkg for our dev tools B)
goodboy Sep 28, 2023
7bed470
Start `.devx.cli` extensions for pop CLI frameworks
goodboy Sep 28, 2023
de89e3a
Add libp2p style "multi-address" parser from `piker`
goodboy Sep 29, 2023
86da79a
Rename to `parse_maddr()` and fill out doc strings
goodboy Sep 29, 2023
e94f126
Move `maybe_open_crash_handler()` CLI `--pdb`-driven wrapper to debug…
goodboy Oct 2, 2023
4314a59
Add post-mortem catch around failed transport addr binds to aid with …
goodboy Oct 3, 2023
78c0d2b
Start inter-peer cancellation test mod
goodboy Oct 5, 2023
18a1634
Add shielding support to `.pause()`
goodboy Oct 6, 2023
d24a9e1
Msg-ified `ContextCancelled`s sub-error type should always be just, i…
goodboy Oct 7, 2023
c4cd573
Drop pause line from ctx cancel handler block in test
goodboy Oct 7, 2023
a09b856
Oof, default reg addrs needs to be in `list[tuple]` form..
goodboy Oct 7, 2023
919e462
Write more comprehensive `Portal.cancel_actor()` doc str
goodboy Oct 8, 2023
575a24a
Always raise remote (cancelled) error if set
goodboy Oct 10, 2023
6d951c5
Comment all `.pause(shield=True)` attempts again, need to solve cance…
goodboy Oct 10, 2023
2fdb8fc
Factor non-yield stream msg processing into helper
goodboy Oct 16, 2023
07cec02
Add comments around diff between `C/context` refs
goodboy Oct 16, 2023
ae326cb
Ignore kbis in `open_crash_handler()` by default
goodboy Oct 16, 2023
ab2664d
Runtime level log on debug REPL exits
goodboy Oct 16, 2023
e4a6223
`._exceptions`: typing and error unpacking updates
goodboy Oct 16, 2023
534e5d1
Drop `msg` kwarg from `Context.cancel()`
goodboy Oct 17, 2023
7eb31f3
Runtime import `.get_root()` in stdin hijacker to avoid import cycle
goodboy Oct 17, 2023
63b1488
Get mega-pedantic in `Portal.open_context()`
goodboy Oct 17, 2023
43b659d
Tidy/clarify another `._runtime` comment
goodboy Oct 18, 2023
87c1113
Always set default reg addr in `find_actor()` if not defined
goodboy Oct 18, 2023
ca3f7a1
Add a first serious inter-peer remote cancel suite
goodboy Oct 18, 2023
fcc8cee
._root: set a `_default_lo_addrs` and apply it when not provided by c…
goodboy Oct 18, 2023
215fec1
Change old `._debug._pause()` name, cherry to #362 re `greenback`
goodboy Oct 18, 2023
0c74b04
Facepalm, `wait_for_actor()` dun take an addr `list`..
goodboy Oct 18, 2023
190845c
Add masked super timeout line to `do_hard_kill()` for would-be runtim…
goodboy Oct 18, 2023
1e689ee
Rename fixture `arb_addr` -> `reg_addr` and set the session value glo…
goodboy Oct 18, 2023
6b1ceee
Type out the full-fledged streaming ex.
goodboy Oct 18, 2023
0e94572
Port all tests to new `reg_addr` fixture name
goodboy Oct 18, 2023
022bf8c
Ensure `registry_addrs` is always set to something
goodboy Oct 18, 2023
2e81ccf
Dump `.msgdata` in `RemoteActorError.__repr__()`
goodboy Oct 18, 2023
42d621b
Always dynamically re-read the `._root._default_lo_addrs` value in `f…
goodboy Oct 18, 2023
a3ed30e
Get remaining suites passing..
goodboy Oct 19, 2023
1d6f555
Expose per-actor registry addrs via `.reg_addrs`
goodboy Oct 19, 2023
9da3b63
Change remaining internals to use `Actor.reg_addrs`
goodboy Oct 19, 2023
2f0bed3
Ignore `greenback` import error if not installed
goodboy Oct 19, 2023
0518b3a
Move `MessagingError` into `._exceptions` set
goodboy Oct 23, 2023
5a94e8f
Raise a `MessagingError` from the src error on msging edge cases
goodboy Oct 23, 2023
131674e
Be mega-pedantic with `ContextCancelled` semantics
goodboy Oct 23, 2023
df31047
Be ultra-correct in `Portal.open_context()`
goodboy Oct 23, 2023
f4e6346
Tweak `Channel._cancel_called` comment
goodboy Oct 23, 2023
b77d123
Fix `Context.result()` call to be in runtime scope
goodboy Oct 23, 2023
ecb525a
Adjust test details where `Context.cancel()` is called
goodboy Oct 23, 2023
ef0cfc4
Get inter-peer suite passing with all `Context` state checks!
goodboy Oct 23, 2023
d651f3d
Tons of interpeer test cleanup
goodboy Oct 25, 2023
227c9ea
Test with `any(portals)` since `gather_contexts()` will return `list[…
goodboy Nov 6, 2023
48accbd
Fix doc string "its" typo..
goodboy Nov 6, 2023
87cd725
Add `open_root_actor(ensure_registry: bool)`
goodboy Nov 7, 2023
3f15923
More thurough hard kill doc strings
goodboy Dec 11, 2023
f415fc4
`.discovery.get_arbiter()`: add warning around this now deprecated usage
goodboy Dec 12, 2023
250275d
Guarding for IPC failures in `._runtime._invoke()`
goodboy Jan 2, 2024
bea31f6
._child: remove some unused imports..
goodboy Jan 2, 2024
8143848
Use `import <name> as <name>,` style over `__all__` in pkg mod
goodboy Jan 2, 2024
0002418
`StackLevelAdapter._log(stacklevel: int)` for custom levels..
goodboy Jan 2, 2024
ce7b8a5
Drop unused walrus assign of `re`
goodboy Jan 2, 2024
fdf3a1b
Only use `greenback` if actor-runtime is up..
goodboy Jan 2, 2024
0bcdea2
Fmt repr as multi-line style call
goodboy Jan 2, 2024
734bc09
Move missing-key-in-msg raiser to `._exceptions`
goodboy Jan 2, 2024
0294455
`_root`: drop unused `typing` import
goodboy Jan 2, 2024
28ea8e7
Bump timeout on resource cache test a bitty bit.
goodboy Jan 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Dump .msgdata in RemoteActorError.__repr__()
  • Loading branch information
goodboy committed Oct 18, 2023
commit 2e81ccf5b4fdbf893f9033eb1cb1f8ae9a683e4c
37 changes: 33 additions & 4 deletions tractor/_exceptions.py
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
"""
import builtins
import importlib
from pprint import pformat
from typing import (
Any,
Type,
@@ -38,12 +39,17 @@ class ActorFailure(Exception):
"General actor failure"


# TODO: rename to just `RemoteError`?
class RemoteActorError(Exception):
'''
Remote actor exception bundled locally
A box(ing) type which bundles a remote actor `BaseException` for
(near identical, and only if possible,) local object/instance
re-construction in the local process memory domain.

Normally each instance is expected to be constructed from
a special "error" IPC msg sent by some remote actor-runtime.

'''
# TODO: local recontruction of remote exception deats
def __init__(
self,
message: str,
@@ -53,13 +59,36 @@ def __init__(
) -> None:
super().__init__(message)

self.type = suberror_type
self.msgdata = msgdata
# TODO: maybe a better name?
# - .errtype
# - .retype
# - .boxed_errtype
# - .boxed_type
# - .remote_type
# also pertains to our long long oustanding issue XD
# https://github.com/goodboy/tractor/issues/5
self.type: str = suberror_type
self.msgdata: dict[str, Any] = msgdata

@property
def src_actor_uid(self) -> tuple[str, str] | None:
return self.msgdata.get('src_actor_uid')

def __repr__(self) -> str:
if remote_tb := self.msgdata.get('tb_str'):
pformat(remote_tb)
return (
f'{type(self).__name__}(\n'
f'msgdata={pformat(self.msgdata)}\n'
')'
)

return super().__repr__(self)

# TODO: local recontruction of remote exception deats
# def unbox(self) -> BaseException:
# ...


class InternalActorError(RemoteActorError):
'''