cloud-custodian / cloud-custodian/cel-python

Are celpy Environments thread safe?

Đang mở
#38 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
documentation help wanted question
Ngôn ngữ chính
Python
Star
174
Fork
40
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello!

I was wondering if a celpy Environment instance could be shared amongst threads, or if we should create a new instance when we want to create a runner for a new expression.

I tried to look through the docs and source code but didn't find any reference to this.

One thing I've noticed though is that, when we call the program method, the code is doing an intermediate assignment to an instance variable of the environment, before returning, which I believe can be problematic in terms of thread preemption.
```
self.runnable = runner_class(self, expr, functions)
return self.runnable
```

Nonetheless I might have missed something and would like to get your feedback on this use case.

Thank you very much!

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

Hướng nghiên cứu

The issue names Environment.program and the self.runnable assignment but no file or test. Start by tracing that implementation and searching the documentation and source for existing thread-safety guarantees; exercise shared and per-thread Environment use if coverage is absent. Done means an explicit supported-usage answer, with documentation or a regression test reflecting it.

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
Ít trao đổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.