cloud-custodian / cloud-custodian/cel-python
Are celpy Environments thread safe?
- Langage dominant
- Python
- Étoiles
- 174
- Forks
- 40
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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!
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
L’issue mentionne Environment.program et l’affectation de self.runnable, mais n’indique aucun fichier ni test. Commencez par retracer cette implémentation et rechercher dans la documentation et le code source les garanties existantes concernant la sécurité des threads ; testez l’utilisation partagée et par thread de Environment si la couverture est absente. Le travail est terminé lorsqu’une réponse explicite indique quelle utilisation est prise en charge, et que celle-ci est reflétée par la documentation ou un test de régression.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- documentation
- Type d'issue
- Documentation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Calme
- Clarté
- À clarifier
- Accessibilité débutants
- 35/100