Skip to content

Commit 99e4e65

Browse files
committed
issue: 4633470 fix generate_docs.py +update README
Fix bug in generate_docs.py where non-dict properties caused processing failures. Add proper type checking and error handling to prevent crashes when encountering unexpected property types in the JSON schema. Changes in generate_docs.py: - Add type check to skip non-dict properties - Wrap property processing in try-catch block - Add error reporting with property path context Regenerate README documentation with the fixed script: - Document memory size suffix support (B, KB, MB, GB) for memory params - Add missing threading behavior options (with_wakeup/no_wakeup) - Simplify worker threads documentation for better clarity - Fix inconsistent default value formatting This ensures robust documentation generation and provides users with complete information about memory size formatting and threading options. Signed-off-by: Tomer Cabouly <[email protected]>
1 parent 8eeccc7 commit 99e4e65

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

README

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ Avoid expensive extra checks to reduce the initialization time. Maps to **XLIO_Q
238238
Default value is 0 (Disabled)
239239

240240
core.resources.external_memory_limit
241-
Memory limit for external user allocator. Maps to **XLIO_MEMORY_LIMIT_USER** environment variable. The user allocator can optionally be provided with XLIO extra API. Default value 0 makes XLIO use the core.resources.memory_limit value for user allocations.
241+
Memory limit for external user allocator. Maps to **XLIO_MEMORY_LIMIT_USER** environment variable. The user allocator can optionally be provided with XLIO extra API. Default value 0 makes XLIO use the core.resources.memory_limit value for user allocations. Supports suffixes: B, KB, MB, GB.
242242
Default value is 0
243243

244244
core.resources.heap_metadata_block_size
245-
Size of metadata block added to every heap allocation. Maps to **XLIO_HEAP_METADATA_BLOCK** environment variable.
245+
Size of metadata block added to every heap allocation. Maps to **XLIO_HEAP_METADATA_BLOCK** environment variable. Supports suffixes: B, KB, MB, GB.
246246
Default value is 32 MB
247247

248248
core.resources.hugepages.enable
@@ -254,7 +254,7 @@ Force specific hugepage size for XLIO internal memory allocations. Value 0 allow
254254
Default value is 0
255255

256256
core.resources.memory_limit
257-
Pre-allocated memory limit for buffers. Maps to **XLIO_MEMORY_LIMIT** environment variable. Note that the limit does not include dynamic memory allocation and XLIO memory consumption can exceed the limit. A value of 0 means unlimited memory allocation.
257+
Pre-allocated memory limit for buffers. Maps to **XLIO_MEMORY_LIMIT** environment variable. Note that the limit does not include dynamic memory allocation and XLIO memory consumption can exceed the limit. A value of 0 means unlimited memory allocation. Supports suffixes: B, KB, MB, GB.
258258
Default value is 2048 MB
259259

260260
core.signals.sigint.exit
@@ -289,7 +289,7 @@ Control whether XLIO should support fork. Maps to **XLIO_FORK** environment vari
289289
Default value is 1 (Enabled)
290290

291291
core.syscall.sendfile_cache_limit
292-
Memory limit for the mapping cache which is used by sendfile(). Maps to **XLIO_ZC_CACHE_THRESHOLD** environment variable.
292+
Memory limit for the mapping cache which is used by sendfile(). Maps to **XLIO_ZC_CACHE_THRESHOLD** environment variable. Supports suffixes: B, KB, MB, GB.
293293
Default value is 10240 MB
294294

295295

@@ -830,7 +830,9 @@ performance.threading.internal_handler.behavior
830830
Select which TCP control flows are done in the internal thread. Maps to **XLIO_TCP_CTL_THREAD** environment variable. This feature should be kept disabled if using blocking poll/select (epoll is OK).
831831
Use value of 'disable'/0 to disable.
832832
Use value of 'delegate'/1 to handle TCP timers in application context threads. In this mode the socket must be handled by the same thread from the time of its creation to the time of its destruction. Otherwise, it may lead to an unexpected behaviour.
833-
Default value is disabled
833+
Use value of 'with_wakeup'/2 for waking up the thread when there is work to do.
834+
Use value of 'no_wakeup'/3 for waiting for thread timer to expire.
835+
Default value is 0
834836

835837
performance.threading.internal_handler.timer_msec
836838
Control XLIO internal thread wakeup timer resolution (in milliseconds). Maps to **XLIO_TIMER_RESOLUTION_MSEC** environment variable.
@@ -844,17 +846,9 @@ Default: 0 (Spin)
844846
Default value is 0 (Disabled)
845847

846848
performance.threading.worker_threads
847-
Controls which mode is used to handle networking and progress sockets.
848-
Applicable only to POSIX API.
849-
There are two available modes: Run to completion mode and Worker Threads mode.
850-
Run to completion mode:
851-
Only application execution contexts progress networking as part of socket related syscalls.
852-
In this mode, XLIO depends on the application to provide execution context to XLIO.
853-
Worker Threads Mode:
854-
XLIO spawns worker threads. Worker threads progress networking without dependency on the application to provide execution context to XLIO.
855-
0 - Run to completion mode
856-
Number greater than 0 - Worker Threads mode with number of XLIO worker threads specified by the value.
857-
Default: 0
849+
Controls which execution model and number of worker threads to be used to handle networking and progress sockets.
850+
Default value is 0
851+
858852

859853
================================================================================
860854

generate_docs.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,20 @@ def _process_properties(
115115
# Skip if we've already processed this property
116116
if current_path in self.processed_props:
117117
continue
118-
118+
119+
if not isinstance(prop_data, dict):
120+
continue
121+
119122
self.processed_props.add(current_path)
120-
123+
121124
# Extract property information
122-
description = prop_data.get("description", "")
123-
default = prop_data.get("default", None)
124-
env_var = ConfigPropertyParser.extract_env_var(description)
125+
try:
126+
description = prop_data.get("description", "")
127+
default = prop_data.get("default", None)
128+
env_var = ConfigPropertyParser.extract_env_var(description)
129+
except Exception as e:
130+
print(f"Error processing property {current_path}: {e}")
131+
sys.exit(1)
125132

126133
# If this is an object with properties, process its children
127134
if prop_data.get("type") == "object":

0 commit comments

Comments
 (0)