Skip to content

Conversation

@chvvkumar
Copy link
Owner

@chvvkumar chvvkumar commented Jan 6, 2026

📋 Overview

This pull request primarily addresses a bug in alpaca/device.py where the client connection duration timer was incorrectly resetting. It refactors the client tracking mechanism by separating connection start times from heartbeat timestamps. This ensures more accurate monitoring of client activity and connection longevity within the system.

🔄 Changes by Category

  • Bug Fixes:
    • Corrected the client connection duration timer in alpaca/device.py, preventing it from resetting every second and ensuring accurate duration tracking.
    • Resolved issues in client heartbeat tracking and stale client detection logic.
  • Refactoring:
    • Separated the tracking of client connection start time from the last seen heartbeat timestamp.
    • Introduced a client_last_seen dictionary to explicitly store the last heartbeat timestamp for each client.
    • Modified the register_heartbeat method to update only the client_last_seen timestamp, preserving the client's original connection start time.
    • Updated the _prune_stale_clients method to utilize the new client_last_seen dictionary for more accurate timeout detection.

📊 Analyzed 3 commit(s) | 🕐 Updated: 2026-01-06T16:00:34.727Z | Generated by GitHub Actions


- Separate connection start time from last heartbeat tracking

- Add client_last_seen dictionary for heartbeat timestamps

- Fix register_heartbeat to only update last_seen, preserving connection start time

- Update _prune_stale_clients to use last_seen for timeout detection

- Fix workflow cache move step to check directory existence

- Add workspace cleanup step to fix permission issues
@github-actions github-actions bot changed the title Snd Resolve client connection duration and heartbeat tracking issues Jan 6, 2026
@chvvkumar chvvkumar merged commit 1465bef into dev Jan 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants