diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-19 12:59:58 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-19 12:59:58 +0300 |
commit | 24745e8d27903ae741565c5e15f147d206a1030e (patch) | |
tree | c348c00f39eb76c27ec516792bd6ed53c6b628ab /source | |
parent | 74420d95b32a2d91af52fcf6e2fa0c4d0a53469e (diff) |
Fix liboverride extreme resync times in case of libraries dependency loops.
That max number of `10000` level of recursivity was a typo (should have
been `1000`), but even that is way too high, typical sane situation
should not lead to more than a few tens of levels, so reducing the max
level to 200.
Also improve error message with more context info about the issue.
Found while investigating issues for the Blender Studio's Heist production.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index b83d30a27bf..768ac4f606f 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -2335,13 +2335,15 @@ static int lib_override_sort_libraries_func(LibraryIDLinkCallbackData *cb_data) if (id != NULL && ID_IS_LINKED(id) && id->lib != id_owner->lib) { const int owner_library_indirect_level = ID_IS_LINKED(id_owner) ? id_owner->lib->temp_index : 0; - if (owner_library_indirect_level > 10000) { - CLOG_ERROR( - &LOG, - "Levels of indirect usages of libraries is way too high, skipping further building " - "loops (Involves at least '%s' and '%s')", - id_owner->lib->filepath, - id->lib->filepath); + if (owner_library_indirect_level > 200) { + CLOG_ERROR(&LOG, + "Levels of indirect usages of libraries is way too high, there are most likely " + "dependency loops, skipping further building loops (involves at least '%s' from " + "'%s' and '%s' from '%s')", + id_owner->name, + id_owner->lib->filepath, + id->name, + id->lib->filepath); BLI_assert(0); return IDWALK_RET_NOP; } |