From db96a35827878496519d867732427d86bd651221 Mon Sep 17 00:00:00 2001 From: maximlt Date: Fri, 2 Dec 2022 14:26:32 +0100 Subject: [PATCH 1/2] wrap custom options ids in a list --- holoviews/core/options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/holoviews/core/options.py b/holoviews/core/options.py index 597511c34c..0d7906dbe6 100644 --- a/holoviews/core/options.py +++ b/holoviews/core/options.py @@ -1787,7 +1787,7 @@ def id_offset(cls): """ max_ids = [] for backend in Store.renderers.keys(): - store_ids = Store.custom_options(backend=backend).keys() + store_ids = list(Store.custom_options(backend=backend)) max_id = max(store_ids)+1 if len(store_ids) > 0 else 0 max_ids.append(max_id) # If no backends defined (e.g. plotting not imported) return zero From f35d5fea8cf793d3c69cc5876f5fe02b2dcf859e Mon Sep 17 00:00:00 2001 From: maximlt Date: Fri, 2 Dec 2022 14:34:38 +0100 Subject: [PATCH 2/2] add comment --- holoviews/core/options.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/holoviews/core/options.py b/holoviews/core/options.py index 0d7906dbe6..b0e6a4a0a8 100644 --- a/holoviews/core/options.py +++ b/holoviews/core/options.py @@ -1787,7 +1787,9 @@ def id_offset(cls): """ max_ids = [] for backend in Store.renderers.keys(): - store_ids = list(Store.custom_options(backend=backend)) + # Ensure store_ids is immediately cast to list to avoid a + # race condition (#5533) + store_ids = list(Store.custom_options(backend=backend).keys()) max_id = max(store_ids)+1 if len(store_ids) > 0 else 0 max_ids.append(max_id) # If no backends defined (e.g. plotting not imported) return zero