{"id":30344525,"url":"https://github.com/junkdog/axon-timeout-bug-reproduction","last_synced_at":"2025-08-18T12:42:59.029Z","repository":{"id":305706815,"uuid":"1023690054","full_name":"junkdog/axon-timeout-bug-reproduction","owner":"junkdog","description":"TrackingEventProcessor does not restart after janitor timeout interruption","archived":false,"fork":false,"pushed_at":"2025-07-21T14:49:58.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-15T21:20:21.060Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junkdog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-21T14:40:59.000Z","updated_at":"2025-07-21T14:50:02.000Z","dependencies_parsed_at":"2025-07-21T16:42:45.884Z","dependency_job_id":"e8e60561-645f-493d-a138-79a860c8bfee","html_url":"https://github.com/junkdog/axon-timeout-bug-reproduction","commit_stats":null,"previous_names":["junkdog/axon-timeout-bug-reproduction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/junkdog/axon-timeout-bug-reproduction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junkdog%2Faxon-timeout-bug-reproduction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junkdog%2Faxon-timeout-bug-reproduction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junkdog%2Faxon-timeout-bug-reproduction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junkdog%2Faxon-timeout-bug-reproduction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junkdog","download_url":"https://codeload.github.com/junkdog/axon-timeout-bug-reproduction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junkdog%2Faxon-timeout-bug-reproduction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270996286,"owners_count":24681933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-18T12:42:58.249Z","updated_at":"2025-08-18T12:42:58.943Z","avatar_url":"https://github.com/junkdog.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Axon Framework Timeout Bug Reproduction\n\nThis project reproduces a potential bug where TrackingEventProcessor projections do not restart after being interrupted by Axon's janitor timeout mechanism.\n\n## Problem Description\n\nWhen a TrackingEventProcessor thread is interrupted due to timeout (via the janitor thread), the projection may not automatically restart to continue processing events, leading to event processing stalls.\n\n## Project Structure\n\n- **Java 21** with **Kotlin 2.2** and **Spring Boot 3.5.3**  \n- **Axon Framework 4.11.2** (without Axon Server)\n- **H2 in-memory database**\n- **Maven build system**\n\n### Key Components\n\n1. **TestAggregate** - Simple aggregate that emits TestEvent\n2. **TestProjection** - Tracking projection that simulates timeout-provoking behavior\n3. **Timeout Configuration** - Aggressive timeout settings to trigger janitor interruptions\n\n## Timeout Configuration\n\n```yaml\naxon:\n  timeout:\n    enabled: true\n    transaction:\n      event-processor:\n        test-projection:\n          timeout-ms: 5000          # 5 seconds - triggers timeout  \n          warning-threshold-ms: 2000 # 2 seconds\n          warning-interval-ms: 1000  # 1 second\n```\n\n## Reproduction Scenario\n\nThe `TestProjection` simulates problematic behavior:\n\n- **Every 2nd event** sleeps for 15 seconds (exceeds 5-second timeout)\n- **Other events** process immediately \n- Timeout should interrupt the 15-second sleep\n- Projection should restart and continue processing\n\n## Running the Reproduction\n\n### Option 1: Automated Test\n\n```bash\nmvn test -Dtest=TimeoutBugReproductionTest\n```\n\nThe test:\n1. Sends 3 events (event #2 will timeout)  \n2. Checks that all events are eventually processed\n\n## Expected Behavior vs Bug\n\n**Expected:**\n1. Event #2 times out after 5 seconds\n2. Janitor interrupts the projection thread  \n3. TrackingEventProcessor automatically restarts\n4. Event #3 is processed normally\n5. Event #2 is eventually reprocessed\n\n**Bug (confirmed):**\n1. Event #2 times out after 5 seconds\n2. Janitor interrupts the projection thread\n3. **TrackingEventProcessor does NOT restart**\n4. Event #3 is never processed\n5. Processing stalls permanently\n\n## Monitoring\n\nWatch the logs for:\n\n```\n# Normal processing\nINFO  - Processing TestEvent #1 for id: test-1\nINFO  - Successfully processed TestEvent #1 for id: test-1\n\n# Timeout warning  \nWARN  - Event #2 will cause timeout - sleeping for 15 seconds\nWARN  - UnitOfWork of EventProcessor test-projection is taking a long time...\n\n# Janitor interruption\nERROR - UnitOfWork of EventProcessor test-projection has exceeded its timeout...\nERROR - Event processing was interrupted for event #2\n\n# Final test results - Event #3 NEVER gets processed\nINFO  - Processed events: 2, Items in projection: 1\nWARN  - Timeout waiting for projection to process 3 items. Current count: 1\nERROR - All items should be in projection (found 1)\n```\n\n## Key Files\n\n- `TestProjection.kt` - Contains timeout-provoking behavior\n- `application.yml` - Aggressive timeout configuration  \n- `TimeoutBugReproductionTest.kt` - Automated reproduction test\n\n## Dependencies\n\nThis project uses only:\n- Java 21\n- Axon Framework 4.11.2 (spring-boot-starter, excluding axon-server-connector)\n- Spring Boot 3.5.3\n- Kotlin 2.2.0  \n- H2 Database\n- No external Axon Server required\n\nThe POM is fully self-contained and can be shared independently.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunkdog%2Faxon-timeout-bug-reproduction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunkdog%2Faxon-timeout-bug-reproduction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunkdog%2Faxon-timeout-bug-reproduction/lists"}