Drop cloudpickle dependency#133
Merged
goodboy merged 10 commits intogoodboy:masterfrom Jul 29, 2020
guilledk:drop_cloudpickle
Merged
Drop cloudpickle dependency#133goodboy merged 10 commits intogoodboy:masterfrom guilledk:drop_cloudpickle
goodboy merged 10 commits intogoodboy:masterfrom
guilledk:drop_cloudpickle
Conversation
Collaborator
Author
|
Leavin another run trace here because of the rebase: |
df5e702 to
5a27065
Compare
This was referenced Jul 27, 2020
added 2 commits
July 27, 2020 14:55
goodboy
reviewed
Jul 27, 2020
goodboy
reviewed
Jul 27, 2020
goodboy
reviewed
Jul 27, 2020
tractor/_child.py
Outdated
|
|
||
| parser = argparse.ArgumentParser() | ||
|
|
||
| parser.add_argument("name") |
Owner
There was a problem hiding this comment.
as discussed we should only need 3 args here:
uid,loglevel,parent_addr
The rest can be sent at parent data transfer in Actor._async_main().
Owner
There was a problem hiding this comment.
Also I think named args would be good, so like:
uid=('name', '34lkj345-345lkj3450345'), loglevel='info', etc..
goodboy
reviewed
Jul 27, 2020
goodboy
requested changes
Jul 27, 2020
goodboy
reviewed
Jul 28, 2020
goodboy
reviewed
Jul 28, 2020
goodboy
reviewed
Jul 28, 2020
goodboy
reviewed
Jul 28, 2020
goodboy
reviewed
Jul 28, 2020
goodboy
reviewed
Jul 28, 2020
goodboy
reviewed
Jul 28, 2020
goodboy
reviewed
Jul 28, 2020
…el, in early child actor init.
goodboy
reviewed
Jul 28, 2020
In order to have reliable subactor startup we need the following sequence to take place: - connect to the parent actor, handshake and receive runtime state - load exposed modules into memory - start the channel server up fully using the provided bind address - finally, start processing new messages from the parent Add a bunch more comments to clarify all this.
This was referenced Jul 29, 2020
goodboy
reviewed
Jul 29, 2020
tractor/_child.py
Outdated
| from ._entry import _trio_main | ||
|
|
||
|
|
||
| """This is the "bootloader" for actors started using the native trio backend. |
Owner
There was a problem hiding this comment.
Oh, I was gonna say move this to the top of file if you don't mind.
goodboy
reviewed
Jul 29, 2020
tractor/_child.py
Outdated
| trio.run(cloudpickle.load(sys.stdin.buffer)) | ||
|
|
||
| parser = argparse.ArgumentParser() | ||
|
|
Owner
There was a problem hiding this comment.
You can probably also drop these blank lines between argparse calls.
goodboy
reviewed
Jul 29, 2020
|
|
||
| args = parser.parse_args() | ||
|
|
||
| subactor = Actor( |
Owner
There was a problem hiding this comment.
It's funny, __init__() almost feels kinda pointless now except for the mp case.
Owner
|
Man, the races in that CI smh.. |
goodboy
approved these changes
Jul 29, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the new trio backend, we were using cloudpickle to serialize the async function the child will have to pass to trio to run, but this function never changed, it was
Actor._async_main, this function handles the connection and handshake with the parent actor.The real problem was passing the subactor object instance to the newly spawned child.
tractor._actor.Actorinit function params:str,List[str],str,str,Tuple[str, int]This parameters are passed through the child shell arguments and parsed using
argparse.The problem is the following, when running
tests/_test.pyfrom the shell this is the output:Closes #131