Skip to content

Conversation

@youngsofun
Copy link
Member

@youngsofun youngsofun commented Nov 3, 2025

This PR introduces several key improvements to enhance connection management, resource cleanup, and observability across Python, JavaScript, and Rust bindings:

  1. Introduce a global runtime to handle core background operations including heartbeat mechanisms, finalization, and logout procedures.

  2. Implement a global background task that manages heartbeat checks for all active connections, ensuring persistent and reliable connections.

  3. Add a close method to the RowIterator to enable explicit resource release, complementing automatic cleanup.

  4. Enhance resource cleanup logic:

    • Send finalization signals when rows/cursors are dropped or closed (across Python, JavaScript, and Rust)
    • Trigger logout procedures when connections or cursors are dropped or closed (consistent across all bindings)
  5. Initialize env_logger for JavaScript and Python bindings with a default log level of WARN. This provides a configurable debugging pathway via the RUST_LOG environment variable.

  6. Ensure RowIterator maintains a reference to its parent Connection, preventing premature garbage collection of connections while iterators are in use.

@youngsofun youngsofun force-pushed the hb branch 11 times, most recently from 633425c to c546571 Compare November 4, 2025 09:22
@youngsofun
Copy link
Member Author

@sundy-li @everpcpc please review

@sundy-li sundy-li merged commit b41bb04 into databendlabs:main Nov 5, 2025
32 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