Benjamin Bannier created MESOS-5631:
---------------------------------------
Summary: Implement clang-tidy check for incorrect use of capturing
lambdas with Futures
Key: MESOS-5631
URL: https://issues.apache.org/jira/browse/MESOS-5631
Project: Mesos
Issue Type: Improvement
Reporter: Benjamin Bannier
When one enqueues capturing lambdas to a {{Future}} with {{then}} or then
{{onXXX}} variations, in general any actor might execute that callback (no
constraints imposed per se).
This can lead to hard to understand dependencies or bugs if the lambda needs to
access external state (i.e. anything it captures by references/pointer to
instead of by value); instead such callbacks should always be constraint to a
specific actor with {{dispatch}}/{{defer}} to ensure the pointed to data isn't
modified in a concurrent thread.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)