diff --git a/.werks/17278.md b/.werks/17278.md new file mode 100644 index 00000000000..53f44c97753 --- /dev/null +++ b/.werks/17278.md @@ -0,0 +1,18 @@ +[//]: # (werk v2) +# Service grouping long loading or timeout + +key | value +---------- | --- +date | 2024-12-17T13:07:27+00:00 +version | 2.3.0p24 +class | fix +edition | cre +component | multisite +level | 1 +compatible | yes + +When configuring the global setting "Grouping of services in table views" +with specific grouping expressions (for example `(?!.*(CPU)).*`) this could cause +long loading times or even timeouts of view. + +This is now fixed and the grouping works as expected. diff --git a/cmk/gui/views/layout/layouts.py b/cmk/gui/views/layout/layouts.py index 3ec47d66fca..c3d9665376d 100644 --- a/cmk/gui/views/layout/layouts.py +++ b/cmk/gui/views/layout/layouts.py @@ -409,10 +409,14 @@ def try_to_match_group(row: Row) -> GroupSpec | None: group_spec["pattern"], row["service_description"] ): if re.findall(r"(\([^)]*\))", group_spec["pattern"]): - group_spec["title"] = re.sub( - group_spec["pattern"], - escape_regex_chars(group_spec["title"]), - row["service_description"], + return GroupSpec( + title=re.sub( + group_spec["pattern"], + escape_regex_chars(group_spec["title"]), + row["service_description"], + ), + pattern=group_spec["pattern"], + min_items=group_spec["min_items"], ) return group_spec