From a9b4a61620b3d5aecb814245f6a052ad9fdc8190 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 3 Aug 2022 10:21:07 -0400 Subject: [PATCH 1/6] Flip to non-dev version tag --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 90f84c5..0ecbbb4 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ with open('docs/README.rst', encoding='utf-8') as f: setup( name="tractor", - version='0.1.0a5.dev', # alpha zone + version='0.1.0a5', # alpha zone description='structured concurrrent "actors"', long_description=readme, license='AGPLv3', From 4c5d435aacce993b658ef6a1a327fe3b3b442836 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 3 Aug 2022 10:21:37 -0400 Subject: [PATCH 2/6] Fix towncrier bug entry suffix --- nooz/{318.bug.rst => 318.bugfix.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename nooz/{318.bug.rst => 318.bugfix.rst} (100%) diff --git a/nooz/318.bug.rst b/nooz/318.bugfix.rst similarity index 100% rename from nooz/318.bug.rst rename to nooz/318.bugfix.rst From ee02cd2496048d1ee848ad67d68aa5cff9689c50 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 3 Aug 2022 10:50:12 -0400 Subject: [PATCH 3/6] Move misplaced fragment for #305 --- 305.misc.rst => nooz/305.misc.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 305.misc.rst => nooz/305.misc.rst (100%) diff --git a/305.misc.rst b/nooz/305.misc.rst similarity index 100% rename from 305.misc.rst rename to nooz/305.misc.rst From 171f1bc24315d442b4fe52b5528353e8d25313c7 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 3 Aug 2022 10:50:28 -0400 Subject: [PATCH 4/6] Move to using `pyproject.toml` for `towncrier` Add explicit fragment types based on `pytest`'s config and don't manually spec the version. --- nooz/{248.misc.rst => 248.trivial.rst} | 0 nooz/{295.misc.rst => 295.trivial.rst} | 0 nooz/{298.misc.rst => 298.trivial.rst} | 0 nooz/{300.misc.rst => 300.trivial.rst} | 0 nooz/{303.misc.rst => 303.trivial.rst} | 0 nooz/{305.misc.rst => 305.trivial.rst} | 0 nooz/{316.misc.rst => 316.trivial.rst} | 0 nooz/{317.misc.rst => 317.trivial.rst} | 0 pyproject.toml | 28 ++++++++++++++++++++++++++ towncrier.toml | 7 ------- 10 files changed, 28 insertions(+), 7 deletions(-) rename nooz/{248.misc.rst => 248.trivial.rst} (100%) rename nooz/{295.misc.rst => 295.trivial.rst} (100%) rename nooz/{298.misc.rst => 298.trivial.rst} (100%) rename nooz/{300.misc.rst => 300.trivial.rst} (100%) rename nooz/{303.misc.rst => 303.trivial.rst} (100%) rename nooz/{305.misc.rst => 305.trivial.rst} (100%) rename nooz/{316.misc.rst => 316.trivial.rst} (100%) rename nooz/{317.misc.rst => 317.trivial.rst} (100%) create mode 100644 pyproject.toml delete mode 100644 towncrier.toml diff --git a/nooz/248.misc.rst b/nooz/248.trivial.rst similarity index 100% rename from nooz/248.misc.rst rename to nooz/248.trivial.rst diff --git a/nooz/295.misc.rst b/nooz/295.trivial.rst similarity index 100% rename from nooz/295.misc.rst rename to nooz/295.trivial.rst diff --git a/nooz/298.misc.rst b/nooz/298.trivial.rst similarity index 100% rename from nooz/298.misc.rst rename to nooz/298.trivial.rst diff --git a/nooz/300.misc.rst b/nooz/300.trivial.rst similarity index 100% rename from nooz/300.misc.rst rename to nooz/300.trivial.rst diff --git a/nooz/303.misc.rst b/nooz/303.trivial.rst similarity index 100% rename from nooz/303.misc.rst rename to nooz/303.trivial.rst diff --git a/nooz/305.misc.rst b/nooz/305.trivial.rst similarity index 100% rename from nooz/305.misc.rst rename to nooz/305.trivial.rst diff --git a/nooz/316.misc.rst b/nooz/316.trivial.rst similarity index 100% rename from nooz/316.misc.rst rename to nooz/316.trivial.rst diff --git a/nooz/317.misc.rst b/nooz/317.trivial.rst similarity index 100% rename from nooz/317.misc.rst rename to nooz/317.trivial.rst diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..43038b7 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,28 @@ +[tool.towncrier] +package = "tractor" +filename = "NEWS.rst" +directory = "nooz/" +title_format = "tractor {version} ({project_date})" +version = "0.1.0a5" +template = "nooz/_template.rst" +all_bullets = true + + [[tool.towncrier.type]] + directory = "feature" + name = "Features" + showcontent = true + + [[tool.towncrier.type]] + directory = "bugfix" + name = "Bug Fixes" + showcontent = true + + [[tool.towncrier.type]] + directory = "doc" + name = "Improved Documentation" + showcontent = true + + [[tool.towncrier.type]] + directory = "trivial" + name = "Trivial/Internal Changes" + showcontent = true diff --git a/towncrier.toml b/towncrier.toml deleted file mode 100644 index e97b0a0..0000000 --- a/towncrier.toml +++ /dev/null @@ -1,7 +0,0 @@ -[tool.towncrier] -package = "tractor" -filename = "NEWS.rst" -directory = "nooz/" -title_format = "tractor {version} ({project_date})" -version = "0.1.0a4" -template = "nooz/_template.rst" From 3393bc23e4601ff91010b854fda2d9650ac7a5da Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 3 Aug 2022 11:41:23 -0400 Subject: [PATCH 5/6] Generate release news --- NEWS.rst | 137 +++++++++++++++++++++++++++++++++++++++++++ nooz/165.feature.rst | 36 ------------ nooz/248.trivial.rst | 8 --- nooz/295.trivial.rst | 3 - nooz/298.trivial.rst | 2 - nooz/300.trivial.rst | 3 - nooz/303.trivial.rst | 4 -- nooz/304.feature.rst | 12 ---- nooz/305.trivial.rst | 7 --- nooz/316.trivial.rst | 5 -- nooz/317.trivial.rst | 8 --- nooz/318.bugfix.rst | 13 ---- pyproject.toml | 2 +- 13 files changed, 138 insertions(+), 102 deletions(-) delete mode 100644 nooz/165.feature.rst delete mode 100644 nooz/248.trivial.rst delete mode 100644 nooz/295.trivial.rst delete mode 100644 nooz/298.trivial.rst delete mode 100644 nooz/300.trivial.rst delete mode 100644 nooz/303.trivial.rst delete mode 100644 nooz/304.feature.rst delete mode 100644 nooz/305.trivial.rst delete mode 100644 nooz/316.trivial.rst delete mode 100644 nooz/317.trivial.rst delete mode 100644 nooz/318.bugfix.rst diff --git a/NEWS.rst b/NEWS.rst index 95c3bdb..61ee206 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -4,6 +4,143 @@ Changelog .. towncrier release notes start +tractor 0.1.0a5 (2022-08-03) +============================ + +Features +-------- + +- `#165 `_: Add SIGINT + protection to our `pdbpp` based debugger subystem such that for + (single-depth) actor trees in debug mode we ignore interrupts in any + actor currently holding the TTY lock thus avoiding clobbering IPC + connections and/or task and process state when working in the REPL. + + As a big note currently so called "nested" actor trees (trees with + actors having more then one parent/ancestor) are not fully supported + since we don't yet have a mechanism to relay the debug mode knowledge + "up" the actor tree (for eg. when handling a crash in a leaf actor). + As such currently there is a set of tests and known scenarios which will + result in process cloberring by the zombie repaing machinery and these + have been documented in https://github.com/goodboy/tractor/issues/320. + + The implementation details include: + + - utilizing a custom SIGINT handler which we apply whenever an actor's + runtime enters the debug machinery, which we also make sure the + stdlib's `pdb` configuration doesn't override (which it does by + default without special instance config). + - litter the runtime with `maybe_wait_for_debugger()` mostly in spots + where the root actor should block before doing embedded nursery + teardown ops which both cancel potential-children-in-deubg as well + as eventually trigger zombie reaping machinery. + - hardening of the TTY locking semantics/API both in terms of IPC + terminations and cancellation and lock release determinism from + sync debugger instance methods. + - factoring of locking infrastructure into a new `._debug.Lock` global + which encapsulates all details of the ``trio`` sync primitives and + task/actor uid management and tracking. + + We also add `ctrl-c` cases throughout the test suite though these are + disabled for py3.9 (`pdbpp` UX differences that don't seem worth + compensating for, especially since this will be our last 3.9 supported + release) and there are a slew of marked cases that aren't expected to + work in CI more generally (as mentioned in the "nested" tree note + above) despite seemingly working when run manually on linux. + +- `#304 `_: Add a new + ``to_asyncio.LinkedTaskChannel.subscribe()`` which gives task-oriented + broadcast functionality semantically equivalent to + ``tractor.MsgStream.subscribe()`` this makes it possible for multiple + ``trio``-side tasks to consume ``asyncio``-side task msgs in tandem. + + Further Improvements to the test suite were added in this patch set + including a new scenario test for a sub-actor managed "service nursery" + (implementing the basics of a "service manager") including use of + *infected asyncio* mode. Further we added a lower level + ``test_trioisms.py`` to start to track issues we need to work around in + ``trio`` itself which in this case included a bug we were trying to + solve related to https://github.com/python-trio/trio/issues/2258. + + +Bug Fixes +--------- + +- `#318 `_: Fix + a previously undetected ``trio``-``asyncio`` task lifetime linking + issue with the ``to_asyncio.open_channel_from()`` api where both sides + where not properly waiting/signalling termination and it was possible + for ``asyncio``-side errors to not propagate due to a race condition. + + The implementation fix summary is: + - add state to signal the end of the ``trio`` side task to be + read by the ``asyncio`` side and always cancel any ongoing + task in such cases. + - always wait on the ``asyncio`` task termination from the ``trio`` + side on error before maybe raising said error. + - always close the ``trio`` mem chan on exit to ensure the other + side can detect it and follow. + + +Trivial/Internal Changes +------------------------ + +- `#248 `_: Adjust the + `tractor._spawn.soft_wait()` strategy to avoid sending an actor cancel + request (via `Portal.cancel_actor()`) if either the child process is + detected as having terminated or the IPC channel is detected to be + closed. + + This ensures (even) more deterministic inter-actor cancellation by + avoiding the timeout condition where possible when a whild never + sucessfully spawned, crashed, or became un-contactable over IPC. + +- `#295 `_: Add an + experimental ``tractor.msg.NamespacePath`` type for passing Python + objects by "reference" through a ``str``-subtype message and using the + new ``pkgutil.resolve_name()`` for reference loading. + +- `#298 `_: Add a new + `tractor.experimental` subpackage for staging new high level APIs and + subystems that we might eventually make built-ins. + +- `#300 `_: Update to and + pin latest ``msgpack`` (1.0.3) and ``msgspec`` (0.4.0) both of which + required adjustments for backwards imcompatible API tweaks. + +- `#303 `_: Fence off + ``multiprocessing`` imports until absolutely necessary in an effort to + avoid "resource tracker" spawning side effects that seem to have + varying degrees of unreliability per Python release. Port to new + ``msgspec.DecodeError``. + +- `#305 `_: Add + ``tractor.query_actor()`` an addr looker-upper which doesn't deliver + a ``Portal`` instance and instead just a socket address ``tuple``. + + Sometimes it's handy to just have a simple way to figure out if + a "service" actor is up, so add this discovery helper for that. We'll + prolly just leave it undocumented for now until we figure out + a longer-term/better discovery system. + +- `#316 `_: Run windows + CI jobs on python 3.10 after some hacks for ``pdbpp`` dependency + issues. + + Issue was to do with the now deprecated `pyreadline` project which + should be changed over to `pyreadline3`. + +- `#317 `_: Drop use of + the ``msgpack`` package and instead move fully to the ``msgspec`` + codec library. + + We've now used ``msgspec`` extensively in production and there's no + reason to not use it as default. Further this change preps us for the up + and coming typed messaging semantics (#196), dialog-unprotocol system + (#297), and caps-based messaging-protocols (#299) planned before our + first beta. + + tractor 0.1.0a4 (2021-12-18) ============================ diff --git a/nooz/165.feature.rst b/nooz/165.feature.rst deleted file mode 100644 index 8eb6a52..0000000 --- a/nooz/165.feature.rst +++ /dev/null @@ -1,36 +0,0 @@ -Add SIGINT protection to our `pdbpp` based debugger subystem such that -for (single-depth) actor trees in debug mode we ignore interrupts in any -actor currently holding the TTY lock thus avoiding clobbering IPC -connections and/or task and process state when working in the REPL. - -As a big note currently so called "nested" actor trees (trees with -actors having more then one parent/ancestor) are not fully supported -since we don't yet have a mechanism to relay the debug mode knowledge -"up" the actor tree (for eg. when handling a crash in a leaf actor). -As such currently there is a set of tests and known scenarios which will -result in process cloberring by the zombie repaing machinery and these -have been documented in https://github.com/goodboy/tractor/issues/320. - -The implementation details include: - -- utilizing a custom SIGINT handler which we apply whenever an actor's - runtime enters the debug machinery, which we also make sure the - stdlib's `pdb` configuration doesn't override (which it does by - default without special instance config). -- litter the runtime with `maybe_wait_for_debugger()` mostly in spots - where the root actor should block before doing embedded nursery - teardown ops which both cancel potential-children-in-deubg as well - as eventually trigger zombie reaping machinery. -- hardening of the TTY locking semantics/API both in terms of IPC - terminations and cancellation and lock release determinism from - sync debugger instance methods. -- factoring of locking infrastructure into a new `._debug.Lock` global - which encapsulates all details of the ``trio`` sync primitives and - task/actor uid management and tracking. - -We also add `ctrl-c` cases throughout the test suite though these are -disabled for py3.9 (`pdbpp` UX differences that don't seem worth -compensating for, especially since this will be our last 3.9 supported -release) and there are a slew of marked cases that aren't expected to -work in CI more generally (as mentioned in the "nested" tree note -above) despite seemingly working when run manually on linux. diff --git a/nooz/248.trivial.rst b/nooz/248.trivial.rst deleted file mode 100644 index 453c829..0000000 --- a/nooz/248.trivial.rst +++ /dev/null @@ -1,8 +0,0 @@ -Adjust the `tractor._spawn.soft_wait()` strategy to avoid sending an -actor cancel request (via `Portal.cancel_actor()`) if either the child -process is detected as having terminated or the IPC channel is detected -to be closed. - -This ensures (even) more deterministic inter-actor cancellation by -avoiding the timeout condition where possible when a whild never -sucessfully spawned, crashed, or became un-contactable over IPC. diff --git a/nooz/295.trivial.rst b/nooz/295.trivial.rst deleted file mode 100644 index 74a0f23..0000000 --- a/nooz/295.trivial.rst +++ /dev/null @@ -1,3 +0,0 @@ -Add an experimental ``tractor.msg.NamespacePath`` type for passing Python -objects by "reference" through a ``str``-subtype message and using the -new ``pkgutil.resolve_name()`` for reference loading. diff --git a/nooz/298.trivial.rst b/nooz/298.trivial.rst deleted file mode 100644 index 77a2acc..0000000 --- a/nooz/298.trivial.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add a new `tractor.experimental` subpackage for staging new high level -APIs and subystems that we might eventually make built-ins. diff --git a/nooz/300.trivial.rst b/nooz/300.trivial.rst deleted file mode 100644 index 4953a68..0000000 --- a/nooz/300.trivial.rst +++ /dev/null @@ -1,3 +0,0 @@ -Update to and pin latest ``msgpack`` (1.0.3) and ``msgspec`` (0.4.0) -both of which required adjustments for backwards imcompatible API -tweaks. diff --git a/nooz/303.trivial.rst b/nooz/303.trivial.rst deleted file mode 100644 index 9464fd5..0000000 --- a/nooz/303.trivial.rst +++ /dev/null @@ -1,4 +0,0 @@ -Fence off ``multiprocessing`` imports until absolutely necessary in an -effort to avoid "resource tracker" spawning side effects that seem to -have varying degrees of unreliability per Python release. Port to new -``msgspec.DecodeError``. diff --git a/nooz/304.feature.rst b/nooz/304.feature.rst deleted file mode 100644 index 820ecf7..0000000 --- a/nooz/304.feature.rst +++ /dev/null @@ -1,12 +0,0 @@ -Add a new ``to_asyncio.LinkedTaskChannel.subscribe()`` which gives -task-oriented broadcast functionality semantically equivalent to -``tractor.MsgStream.subscribe()`` this makes it possible for multiple -``trio``-side tasks to consume ``asyncio``-side task msgs in tandem. - -Further Improvements to the test suite were added in this patch set -including a new scenario test for a sub-actor managed "service nursery" -(implementing the basics of a "service manager") including use of -*infected asyncio* mode. Further we added a lower level -``test_trioisms.py`` to start to track issues we need to work around in -``trio`` itself which in this case included a bug we were trying to -solve related to https://github.com/python-trio/trio/issues/2258. diff --git a/nooz/305.trivial.rst b/nooz/305.trivial.rst deleted file mode 100644 index 1d5df5b..0000000 --- a/nooz/305.trivial.rst +++ /dev/null @@ -1,7 +0,0 @@ -Add ``tractor.query_actor()`` an addr looker-upper which doesn't deliver -a ``Portal`` instance and instead just a socket address ``tuple``. - -Sometimes it's handy to just have a simple way to figure out if -a "service" actor is up, so add this discovery helper for that. We'll -prolly just leave it undocumented for now until we figure out -a longer-term/better discovery system. diff --git a/nooz/316.trivial.rst b/nooz/316.trivial.rst deleted file mode 100644 index bcae2fd..0000000 --- a/nooz/316.trivial.rst +++ /dev/null @@ -1,5 +0,0 @@ -Run windows CI jobs on python 3.10 after some -hacks for ``pdbpp`` dependency issues. - -Issue was to do with the now deprecated `pyreadline` project which -should be changed over to `pyreadline3`. diff --git a/nooz/317.trivial.rst b/nooz/317.trivial.rst deleted file mode 100644 index 724eb93..0000000 --- a/nooz/317.trivial.rst +++ /dev/null @@ -1,8 +0,0 @@ -Drop use of the ``msgpack`` package and instead move fully to the -``msgspec`` codec library. - -We've now used ``msgspec`` extensively in production and there's no -reason to not use it as default. Further this change preps us for the up -and coming typed messaging semantics (#196), dialog-unprotocol system -(#297), and caps-based messaging-protocols (#299) planned before our -first beta. diff --git a/nooz/318.bugfix.rst b/nooz/318.bugfix.rst deleted file mode 100644 index 5bbf4f0..0000000 --- a/nooz/318.bugfix.rst +++ /dev/null @@ -1,13 +0,0 @@ -Fix a previously undetected ``trio``-``asyncio`` task lifetime linking -issue with the ``to_asyncio.open_channel_from()`` api where both sides -where not properly waiting/signalling termination and it was possible -for ``asyncio``-side errors to not propagate due to a race condition. - -The implementation fix summary is: -- add state to signal the end of the ``trio`` side task to be - read by the ``asyncio`` side and always cancel any ongoing - task in such cases. -- always wait on the ``asyncio`` task termination from the ``trio`` - side on error before maybe raising said error. -- always close the ``trio`` mem chan on exit to ensure the other - side can detect it and follow. diff --git a/pyproject.toml b/pyproject.toml index 43038b7..bbb9697 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,8 +2,8 @@ package = "tractor" filename = "NEWS.rst" directory = "nooz/" -title_format = "tractor {version} ({project_date})" version = "0.1.0a5" +title_format = "tractor {version} ({project_date})" template = "nooz/_template.rst" all_bullets = true From 14c6e34658d91b7e1c29bb051452ba3ee4df318c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 3 Aug 2022 10:32:53 -0400 Subject: [PATCH 6/6] Add summary section --- NEWS.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 61ee206..8ba852c 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -7,6 +7,11 @@ Changelog tractor 0.1.0a5 (2022-08-03) ============================ +This is our final release supporting Python 3.9 since we will be moving +internals to the new `match:` syntax from 3.10 going forward and +further, we have officially dropped usage of the `msgpack` library and +happily adopted `msgspec`. + Features --------