This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronserruya
Recipients ronserruya
Date 2020-01-08.10:34:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1578479674.06.0.280894954081.issue39257@roundup.psfhosted.org>
In-reply-to
Content
Sending Context.run to another process via ProccessPoolExecutor hangs forever:

```
from contextvars import ContextVar, copy_context
from concurrent.futures import ProcessPoolExecutor
from multiprocessing import Process

var: ContextVar[int] = ContextVar('var',default=None)

if __name__ == '__main__':
    
    # ***** This hangs forever *****
    with ProcessPoolExecutor(max_workers=1) as pp:
        ctx = copy_context()
        pp.submit(ctx.run, list)

    # ****** This throws 'cannot pickle Context' # ***** This hangs forever *****
    ctx = copy_context()
    p = Process(target=ctx.run, args=(list,))
    p.start()
    p.join()
```

python version is 3.8.0
running on Mac OSX 10.15.1
History
Date User Action Args
2020-01-08 10:34:34ronserruyasetrecipients: + ronserruya
2020-01-08 10:34:34ronserruyasetmessageid: <1578479674.06.0.280894954081.issue39257@roundup.psfhosted.org>
2020-01-08 10:34:34ronserruyalinkissue39257 messages
2020-01-08 10:34:33ronserruyacreate