All notable changes to the "auto-reattach-for-java-debug" extension will be documented in this file.
The format is based on Keep a Changelog.
- Enhanced JDWP port verification to eliminate server-side warning messages and ensure seamless, error-free reattachments during application restarts. Resolves: "Debugger failed to attach: handshake failed - connection prematurally closed"
- Multi-project support: Fixed session tracking to properly handle multiple debug sessions with the same launch name across different projects by using unique
host:port:launchNameidentifiers - Host normalization:
localhostand127.0.0.1are now treated as equivalent - Session limit protection: Added safety limit of 50 monitored sessions to prevent potential memory leaks
- Status bar accuracy: Status bar now correctly reflects the aggregate state of all monitored sessions instead of showing "Idle" when other sessions are still active
- Critical race condition: Fixed issue where status bar would disappear after successful reattachment due to the terminating session's cleanup removing the newly reattached session's state
- Memory leak: Resolved memory leak where manually stopped sessions in 'attached' state were not being cleaned up properly
- Status bar state cache bug: Fixed aggregated status bar not updating when sessions transitioned from 'monitoring' to other states
- Enhanced logging: Included
host:portinformation in relevant log messages for better troubleshooting - Smart status bar:
- Single session: Shows individual session state (maintains current behavior)
- Multiple sessions: Shows aggregate view (e.g., "2 sessions, 1 waiting")
- Tooltip always displays detailed information for all sessions
- Long configuration names are truncated to prevent UI overflow
- Debug information: Added
preLaunchTaskto debug logs to help users understand their configuration - Code quality:
- Centralized session key building logic to eliminate code duplication
- Standardized parameter order across all session management methods
- Added detailed explanatory comments to critical sections explaining why certain logic exists (race condition handling, defensive status bar hiding, session key design)
- Reduced CPU and memory consumption by ~85% during port monitoring
- Faster port availability detection: Connection timeout reduced from 1s to 200ms for more responsive reattachment
- Optimized default wait time for JVM restart: Reduced from 30s to 5s. Important: This timeout measures JVM restart time (typically 1-3s), NOT full application startup. JDWP is ready as soon as the JVM process starts, even if your Spring Boot/Micronaut app takes 30+ seconds to fully initialize.
- Improved resource management: Added proper cleanup for network sockets and timers to prevent resource leaks
- Better VS Code integration: Extension now releases resources immediately when VS Code closes, instead of blocking shutdown
- Eliminated redundant config validation: Configuration validation now happens once during cache refresh instead of on every lookup, reducing CPU usage by ~60-70% for configuration operations
- Faster config lookup: Changed from O(n) array search to O(1) Map lookup for configuration retrieval
- Default
maxWaitTimeMschanged from 30000ms (30s) to 5000ms (5s) - measures JVM restart, not app startup - Maximum allowed
maxWaitTimeMsreduced from 300000ms (5min) to 60000ms (1min) - Socket connection timeout reduced from 1000ms to 200ms
- Emphasized distinction:
maxWaitTimeMsmeasures JVM restart time, NOT full application startup time - Added detailed explanation: JDWP debugging is available immediately when JVM starts, independent of application initialization time
- Clarified when to increase timeout values (Docker Desktop, DevContainers, slow machines)
Initial release.
- Automatically reconnects Java debug sessions when application restarts
- Supports multiple debug configurations simultaneously
- Status bar integration showing current state
- Configurable timeouts and retry intervals
- Intelligent merging of user and workspace settings
- Comprehensive logging in Output panel
- Only supports configurations with fixed ports
- Cannot differentiate manual stop from app restart