temporalio / temporalio/samples-python
[Question] Had some queries around the context propagation example
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 367
- Fork
- 121
- Merge trung bình
- 3 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 11
Mô tả
Hi, was just implementing a context propagation interceptor based on this sample: https://github.com/temporalio/samples-python/blob/main/context_propagation/README.md
After a bit of experimentation, it seems like the the contextvar value is automatically restored to the previous value during multiple concurrent workflow runs and even after an activity finishes executing (if the var was updated inside the activity).
I was wondering if the ContextVar.reset() usage in the sample is redundant? or are there scenarios where it might have an effect?
I'm using a thread pool executor for my worker, so perhaps thats why it seems like ContextVar.reset() does not do anything? https://github.com/temporalio/sdk-python/issues/263
Would it be safe to remove the resetting part when using a thread pool executor for activity tasks? And for workflows in general if I don't want the context vars state to leak between them?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với context_propagation/README.md và xem xét issue #263 được liên kết của Temporal Python SDK. Xác định liệu ContextVar.reset() có thay đổi hành vi của các activity trong thread pool và các workflow đồng thời hay không, sau đó ghi lại hướng dẫn được hỗ trợ cùng mọi điều kiện mà việc reset trở nên quan trọng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- documentation
- Loại issue
- Tài liệu
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100