Is Python multiprocessing supported?
- Lingua principale
- Python
- Stelle
- 338
- Fork
- 147
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hi,
I've been trying to get AWS X-Ray working in my Python application where I spin up separate Python processes via Pool() and apply_async. I'm passing in the segment from .get_trace_entity and setting it in the child process, but I'm still getting exceptions that seem to suggest the segment isn't getting passed properly, e.g.:
```
2020-07-08 15:57:54,703] {{taskinstance.py:1088}} ERROR - 'Segment' object has no attribute 'sampled'
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/local/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/usr/local/lib/python3.7/site-packages/xxxx-0.1-py3.7.egg/xxxx/elt/extract/kinesis_handler.py", line 52, in push_to_kinesis
xray_recorder.begin_subsegment('push_to_kinesis')
File "/usr/local/lib/python3.7/site-packages/aws_xray_sdk/core/recorder.py", line 297, in begin_subsegment
if not segment.sampled:
AttributeError: 'Segment' object has no attribute 'sampled'
"""
```
Does X-Ray support tracking segments through separate processes, or am I just doing something wrong? I noticed in the documentation it only mentions ThreadPoolExecutor, and I know sharing state with separate processes can be a bit fiddly due to pickling.
Thanks in advance!
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dalla sezione della documentazione che menziona ThreadPoolExecutor e i punti di ingresso del recorder get_trace_entity e begin_subsegment. Riproduci il caso Pool() e apply_async descritto nell’issue, quindi determina se il tracing in processi separati è supportato o quale comportamento debba essere documentato; il lavoro è completo quando esiste una risposta chiara e verificata per questo caso d’uso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, python
- Ambito
- backend, observability-sre
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100