Closed
Description
Audit Results
Comprehensive audit of the workflow engine identified 24 antipatterns across goroutine management, synchronization, resource lifecycle, and error handling. 2 critical, 12 high, 8 medium, 2 low.
Critical (2)
- EventProcessor.periodicCleanup() goroutine never stops —
module/event_processor.go:84— Start() spawns goroutine, Stop() is empty, no stop channel or context - CronScheduler data race on
runningandjobs—module/scheduler.go:56-104— plain bool/slice accessed from main and background goroutines without synchronization
High — Missing Panic Recovery (3)
- foreach step goroutines —
module/pipeline_step_foreach.go:219— no recover() (parallel step already has it) - Scheduler job goroutines —
module/scheduler.go:77— panic in a job crashes the process - workflow_call async goroutine —
module/pipeline_step_workflow_call.go:137— fire-and-forget with no recovery
High — Goroutine Lifecycle (2)
- CronScheduler.Stop() blocks forever —
module/scheduler.go:103— unbuffered channel send when goroutine isn't in select - RuntimeManager watcher goroutines untracked —
module/runtime_manager.go:194,334— no WaitGroup, no recovery
High — Unbounded Growth (5)
- RateLimitStep.buckets —
module/pipeline_step_rate_limit.go:119— per-IP buckets never evicted - APIGateway gatewayRateLimiter.buckets —
module/api_gateway.go:84— same pattern - WebhookSender.deadLetter —
module/webhook_sender.go:111— never evicted - globalOAuthCache —
module/pipeline_step_http_call.go:24— entries never removed - InMemoryLock.locks —
scale/distributed_lock.go:50— lock entries never removed
Medium (8)
13-17. Missing panic recovery in: handlers/state_machine.go:401, module/api_workflow_handler.go:47, middleware/apikey.go:75, module/kafka_broker.go:246, module/log_collector.go:199
18. CronScheduler unbuffered stop channel (dupes #6)
19. EventProcessor fragile nested lock ordering — module/event_processor.go:140
20. DBQueryCachedStep cache only evicts on re-access
21. StateMachine maxInstances/TTL not actively enforced
22. observability/reporter.go silently drops registration errors
Low (2)
- RuntimeManager DB errors discarded
- dynamic/resource_limits.go goroutine outlives timeout
Related: #384 (HTTP listener crash — fixed)
Metadata
Metadata
Assignees
Labels
No labels
Activity
intel352 commentedon Mar 28, 2026
Fixed in v0.4.4. All critical and high severity items addressed:
Critical (2):
High — Panic Recovery (3+6 medium):
High — Unbounded Growth (5):
All eviction goroutines have stop mechanisms and panic recovery. All tests pass with -race.