summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-21 23:00:39 +0800
committerruki <[email protected]>2023-02-21 23:00:39 +0800
commit94c2973e49202add48796a75f9b5f64f4f8bb6f1 (patch)
treebc75d29ed20be992fc5f8ac58db6906058b1abf1
parent06cf8bbac41f3eb066609eca269eee3e4983989e (diff)
add todo for #3401
-rw-r--r--xmake/core/base/scheduler.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/core/base/scheduler.lua b/xmake/core/base/scheduler.lua
index fe6522cad..61c438f4a 100644
--- a/xmake/core/base/scheduler.lua
+++ b/xmake/core/base/scheduler.lua
@@ -970,6 +970,20 @@ function scheduler:runloop()
if eventfunc then
ok, errors = eventfunc(self, obj, objevents)
if not ok then
+ -- TODO
+ --
+ -- This causes a direct exit from the entire runloop and
+ -- a quick escape from nested try-catch blocks and coroutines groups.
+ --
+ -- So some try-catch cannot catch these errors, such as when a build fails (in build group).
+ -- @see https://github.com/xmake-io/xmake/issues/3401
+ --
+ -- In theory, we should handle it better. For example, if there is a group that is waiting,
+ -- we should notify the other concurrent threads to exit quickly and then let the group concurrent threads to throw the error.
+ -- That way the outside try-catch can continue to catch it.
+ --
+ -- But implementing it is more complicated and I haven't come up with a solution to let other concurrent processes exit quickly,
+ -- especially if the child process is waiting and we need to notify it of the end quickly as well.
break
end
end