You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The authentication system manages various authentication methods forMCP servers.
324
345
@@ -335,7 +356,7 @@ The authentication system manages various authentication methods for MCP servers
335
356
-**OAuth token authentication**
336
357
-**Custom header authentication**
337
358
338
-
### 7. Reporting System
359
+
### 8. Reporting System
339
360
340
361
The reporting system provides centralized output management and comprehensive result reporting.
341
362
@@ -365,6 +386,79 @@ The reporting system provides centralized output management and comprehensive re
365
386
-**Safety Reports**: Detailed safety system data and blocked operations
366
387
-**Session Reports**: Metadata, configuration, and execution statistics
367
388
389
+
## Runtime Management Details
390
+
391
+
### ProcessManager
392
+
393
+
The `ProcessManager` provides fully asynchronous subprocess lifecycle management with the following capabilities:
394
+
395
+
**Core Features:**
396
+
-**Async Process Creation**: Uses `asyncio.create_subprocess_exec`for non-blocking process spawning
397
+
-**Process Registration**: Automatically registers processes with the watchdog for monitoring
398
+
-**Signal Handling**: Supports graceful termination (SIGTERM) and force kill (SIGKILL) with process-group signaling
399
+
-**Status Tracking**: Maintains comprehensive process state including start time, status, and configuration
400
+
-**Cleanup Management**: Automatic cleanup of finished processes to prevent resource leaks
401
+
402
+
**Process Lifecycle:**
403
+
1. **Start**: Process is created with asyncio, registered with watchdog, and tracked in manager
404
+
2. **Monitor**: Watchdog monitors for hangs and inactivity using activity callbacks
405
+
3. **Stop**: Graceful termination with escalation to force kill if needed
406
+
4. **Cleanup**: Process is unregistered from watchdog and removed from tracking
407
+
408
+
**Configuration Options:**
409
+
-`command`: List of command and arguments
410
+
-`cwd`: Working directory for the process
411
+
-`env`: Environment variables (merged with current environment)
412
+
-`timeout`: Default timeout for process operations
413
+
-`auto_kill`: Whether to automatically kill hanging processes
414
+
-`name`: Human-readable name for logging and identification
415
+
-`activity_callback`: Optional callback to report process activity
416
+
417
+
### ProcessWatchdog
418
+
419
+
The `ProcessWatchdog` provides automated monitoring and termination of hanging processes:
420
+
421
+
**Monitoring Features:**
422
+
-**Activity Tracking**: Monitors process activity through callbacks or timestamps
423
+
-**Hang Detection**: Identifies processes that haven't been active for configured timeout periods
424
+
-**Automatic Termination**: Can automatically kill hanging processes based on policy
425
+
-**Configurable Thresholds**: Separate thresholds for warning, timeout, and force kill
426
+
427
+
**Configuration Options:**
428
+
-`check_interval`: How often to check processes (default: 1.0 seconds)
429
+
-`process_timeout`: Time before process is considered hanging (default: 30.0 seconds)
430
+
-`extra_buffer`: Extra time before auto-kill (default: 5.0 seconds)
431
+
-`max_hang_time`: Maximum time before force kill (default: 60.0 seconds)
432
+
-`auto_kill`: Whether to automatically kill hanging processes (default: true)
433
+
434
+
**Activity Callbacks:**
435
+
Processes can register activity callbacks that return timestamps indicating when they were last active. This allows for more sophisticated hang detection based on actual process activity rather than just time elapsed.
436
+
437
+
### AsyncFuzzExecutor
438
+
439
+
The `AsyncFuzzExecutor` provides controlled concurrency and robust error handling for fuzzing operations:
440
+
441
+
**Concurrency Control:**
442
+
-**Bounded Concurrency**: Uses semaphore to limit concurrent operations
443
+
-**Task Tracking**: Maintains set of running tasks for proper shutdown
444
+
-**Batch Operations**: Execute multiple operations concurrently with result collection
445
+
446
+
**Error Handling:**
447
+
-**Timeout Management**: Configurable timeouts for individual operations
448
+
-**Retry Logic**: Exponential backoff retry mechanism for failed operations
449
+
-**Exception Collection**: Collects and categorizes errors from batch operations
450
+
451
+
**Configuration Options:**
452
+
-`max_concurrency`: Maximum number of concurrent operations (default: 5)
453
+
-`timeout`: Default timeout for operations (default: 30.0 seconds)
454
+
-`retry_count`: Number of retries for failed operations (default: 1)
455
+
-`retry_delay`: Delay between retries (default: 1.0 seconds)
456
+
457
+
**Usage Patterns:**
458
+
-**Single Operations**: Execute individual operations with timeout and error handling
459
+
-**Retry Operations**: Execute operations with automatic retry on failure
460
+
-**Batch Operations**: Execute multiple operations concurrently with bounded concurrency
0 commit comments