-
Notifications
You must be signed in to change notification settings - Fork 35
feat: enhance websocket connection and support stmt2 on Websocket #365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
2290de6
enh: enhance websocket connection handling with improved error manage…
huskar-t a2c05cc
fix: harden websocket reconnect behavior and add disconnect regressio…
huskar-t c5c526e
fix: harden ws reconnect paths and add reliability gate in CI
huskar-t e0fdce1
fix: unify reconnectable send-retry handling in ws modules
huskar-t f362db0
test: reduce ws reconnect test flakiness with dynamic ports
huskar-t 6e6c45d
ci: run full ws reliability gate in stable workflow
huskar-t d6af812
ci: add scheduled ws reliability report workflow
huskar-t ac6b34e
fix: standardize error variable naming for schemaless connection errors
huskar-t 6290174
fix: enhance error handling and add race tests for websocket connections
huskar-t 6d8df7e
fix: prevent sensitive data leakage in error messages during websocke…
huskar-t 8693357
fix: streamline TDengine setup and caching in CI workflows
huskar-t 64776c0
fix: improve websocket connection error handling and testing
huskar-t 2af0080
fix: enhance websocket reconnection logic and add test for nil client…
huskar-t 8afb6ca
feat: add memory management functions and enhance stmt2 binary marsha…
huskar-t f89cb8e
feat: add unified websocket client and deprecate legacy APIs
huskar-t 5b73c4f
feat: implement TMQ consumer with configuration validation and integr…
huskar-t 811d3fe
feat: enhance websocket client with improved error handling and conne…
huskar-t e913c75
feat: enhance topic deletion logic in integration tests for TMQ
huskar-t 77eac85
feat: enhance error handling in client and consumer
huskar-t 7127779
feat: add support for DECIMAL and BLOB data types in stmt2 and relate…
huskar-t a4d2a4b
feat: add support for DECIMAL and BLOB data types in stmt2, including…
huskar-t e070aaa
feat: add main function and database connection logic with error hand…
huskar-t 48e2f2b
feat: enhance error handling with request summaries and connection tr…
huskar-t 26c5ee4
feat: add support for additional data types in stmt2, including DECIM…
huskar-t 9fa9a23
feat: enhance error handling with request summaries and connection tr…
huskar-t 879017d
feat: improve error handling and clean up deprecated code in connecti…
huskar-t 646f047
feat: enhance request logging by improving OTP redaction and adding u…
huskar-t 4ae285a
feat: enhance ResultSet with prefetching support and improve resource…
huskar-t cb43d9d
feat: add compatibility types and methods for stmt2 and enhance respo…
huskar-t 71e826e
feat: add compatibility checks for TD 3.3.6.0 in statement tests and …
huskar-t a712c92
feat: deprecate WriteUint functions for taosWS compatibility and impr…
huskar-t 1f1d1ed
feat: enhance stmt2 initialization with runtime management and improv…
huskar-t 3db188e
feat: increase polling timeout in consumer tests for improved data re…
huskar-t e0dea6d
feat: increase polling timeout in consumer tests for better data retr…
huskar-t 05265a9
feat: enhance DSN configuration with auto-reconnect and additional pa…
huskar-t 8235151
feat: refactor DSN handling for improved database initialization and …
huskar-t bff17c2
feat: mark stmt compatibility APIs as deprecated in favor of unified.…
huskar-t 734cfd4
feat: prioritize active endpoint during reconnect attempts to handle …
huskar-t 45cec01
feat: change failActiveOnReconnect to atomic int32 for improved concu…
huskar-t 3f88c68
feat: add nil checks in connection config tests to prevent panic on n…
huskar-t 09e5c7b
feat: update reconnect logic to allow query and insert replay after w…
huskar-t cb2405b
feat: add logging support with integration for log/slog and enhance p…
huskar-t 8c666c8
feat: replace io.Discard with ioutil.Discard for consistent output ha…
huskar-t bf7bd64
feat: bump version to v3.8.0 and update commit hash
huskar-t e4749a8
feat: add integration tests for raw bind failover and replay logic
huskar-t e162d28
feat: update memory handling for Go 1.17 compatibility and add tests …
huskar-t 59b740e
feat: update Go version compatibility from 1.17 to 1.22 in build conf…
huskar-t 7514884
feat: update Go version compatibility to include 1.17 in build config…
huskar-t 7d00653
feat: remove redundant checkout step from compatibility configuration
huskar-t 0ceafce
feat: increase WebSocket message timeout and write wait durations
huskar-t File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| ignore: | ||
| - "bench" | ||
| - "benchmark" | ||
| - "examples" | ||
| - "examples" | ||
| - "ws/unified/tests/cmd" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| name: 'Setup TDengine Base' | ||
| description: 'Base action for installing TDengine from local package (internal use)' | ||
|
|
||
| inputs: | ||
| install-package: | ||
| description: 'Path to TDengine package or directory' | ||
| required: true | ||
| package-type: | ||
| description: 'Type of package: tar.gz or dir' | ||
| required: false | ||
| default: 'tar.gz' | ||
| start-services: | ||
| description: 'Whether to start taosd and taosadapter' | ||
| required: false | ||
| default: 'true' | ||
| config-files: | ||
| description: 'Comma-separated list of config files to copy' | ||
| required: false | ||
| default: 'taos.cfg,taosadapter.toml' | ||
| version: | ||
| description: 'TDengine version for logging' | ||
| required: false | ||
| default: 'unknown' | ||
| install-args: | ||
| description: 'Extra arguments passed to install.sh' | ||
| required: false | ||
| default: '' | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Install TDengine | ||
| shell: bash | ||
| run: | | ||
| set +o pipefail # Ignore pipe errors (e.g., from head/tail closing pipes early) | ||
| echo "Installing TDengine ${{ inputs.version }}..." | ||
|
|
||
| case "${{ inputs.package-type }}" in | ||
| tar.gz) | ||
| if [ ! -f "${{ inputs.install-package }}" ]; then | ||
| echo "Error: Package file not found: ${{ inputs.install-package }}" | ||
| exit 1 | ||
| fi | ||
| echo "Extracting tarball..." | ||
| tar -zxf "${{ inputs.install-package }}" 2>&1 | tail -20 || true | ||
|
|
||
| # Find extracted directory | ||
| echo "Looking for extracted directory..." | ||
| if [ -d "release" ]; then | ||
| cd "release" | ||
| else | ||
| # Try to find TDengine directory | ||
| for dir in TDengine-server-* tsdb-nightly-*; do | ||
| if [ -d "$dir" ]; then | ||
| echo "Found directory: $dir" | ||
| cd "$dir" | ||
| break | ||
| fi | ||
| done | ||
| fi | ||
| ;; | ||
| dir) | ||
| if [ ! -d "${{ inputs.install-package }}" ]; then | ||
| echo "Error: Package directory not found: ${{ inputs.install-package }}" | ||
| exit 1 | ||
| fi | ||
| cd "${{ inputs.install-package }}" | ||
| ;; | ||
| *) | ||
| echo "Error: Unknown package type: ${{ inputs.package-type }}" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| echo "Running install.sh..." | ||
| if [ -x ./install.sh ] && head -n 1 ./install.sh | grep -q '^#!'; then | ||
| install_cmd=(sudo ./install.sh) | ||
| else | ||
| install_cmd=(sudo sh ./install.sh) | ||
| fi | ||
|
|
||
| if [ -n "${{ inputs.install-args }}" ]; then | ||
| # shellcheck disable=SC2206 | ||
| install_args=(${{ inputs.install-args }}) | ||
| "${install_cmd[@]}" "${install_args[@]}" | ||
| else | ||
| "${install_cmd[@]}" | ||
| fi | ||
| echo "TDengine installed successfully" | ||
|
|
||
| - name: Configure TDengine | ||
| if: inputs.config-files != '' | ||
| shell: bash | ||
| run: | | ||
| echo "Configuring TDengine..." | ||
| sudo mkdir -p /etc/taos | ||
| IFS=',' read -ra configs < <(echo "${{ inputs.config-files }}") | ||
| for config in "${configs[@]}"; do | ||
| config_file=".github/workflows/$config" | ||
| if [ -f "$config_file" ]; then | ||
| echo "Copying $config..." | ||
| sudo cp "$config_file" "/etc/taos/$config" | ||
| else | ||
| echo "Warning: Config file not found: $config_file" | ||
| fi | ||
| done | ||
| echo "Configuration complete" | ||
|
|
||
| - name: Start TDengine services | ||
| if: inputs.start-services == 'true' | ||
| shell: bash | ||
| run: | | ||
| echo "Starting TDengine services..." | ||
|
|
||
| # Create start script for taosd | ||
| cat > start.sh << 'EOF' | ||
| ulimit -n 65535 && TAOS_SUPPORT_VNODES=256 taosd | ||
| EOF | ||
| chmod +x start.sh | ||
|
|
||
| # Start taosd | ||
| echo "Starting taosd..." | ||
| nohup sudo sh ./start.sh >taosd.out 2>&1 & | ||
| sleep 2 | ||
|
|
||
| # Start taosadapter | ||
| echo "Starting taosadapter..." | ||
| sudo taosadapter >taosadapter.out 2>&1 & | ||
| sleep 2 | ||
|
|
||
| echo "Services started" | ||
|
|
||
| - name: Wait for services ready | ||
| if: inputs.start-services == 'true' | ||
| shell: bash | ||
| run: | | ||
| echo "Waiting for taosadapter..." | ||
| for i in $(seq 1 30); do | ||
| if curl -sf "http://127.0.0.1:6041/-/ping" >/dev/null 2>&1; then | ||
| echo "taosadapter is ready" | ||
| exit 0 | ||
| fi | ||
| sleep 1 | ||
| done | ||
| echo "Warning: taosadapter may not be ready" | ||
| echo "Last 20 lines of taosd.log:" | ||
| tail -20 taosd.out 2>/dev/null || true | ||
|
huskar-t marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| name: 'Setup TDengine' | ||
| description: 'Universal TDengine setup action supporting multiple modes' | ||
|
|
||
| inputs: | ||
| mode: | ||
| description: 'Setup mode: nightly, build, or fixed' | ||
| required: true | ||
| default: 'nightly' | ||
| branch: | ||
| description: 'TDengine branch (for nightly mode)' | ||
| required: false | ||
| default: 'main' | ||
| commit-id: | ||
| description: 'TDengine commit ID (for build mode)' | ||
| required: false | ||
| default: '' | ||
| event-key: | ||
| description: 'Event key for cache (for build mode)' | ||
| required: false | ||
| default: '' | ||
| package-path: | ||
| description: 'Path to TDengine package (for fixed mode)' | ||
| required: false | ||
| default: '' | ||
| version: | ||
| description: 'Version string for logging' | ||
| required: false | ||
| default: 'unknown' | ||
| install-args: | ||
| description: 'Extra arguments passed to install.sh' | ||
| required: false | ||
| default: '' | ||
| start-services: | ||
| description: 'Whether to start taosd and taosadapter' | ||
| required: false | ||
| default: 'true' | ||
| config-files: | ||
| description: 'Comma-separated list of config files' | ||
| required: false | ||
| default: 'taos.cfg,taosadapter.toml' | ||
| nightly-url: | ||
| description: 'Base URL for nightly builds (required for nightly mode)' | ||
| required: false | ||
| default: '' | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Validate inputs | ||
| shell: bash | ||
| run: | | ||
| set +o pipefail # Ignore pipe errors | ||
| case "${{ inputs.mode }}" in | ||
| nightly) | ||
| if [ -z "${{ inputs.branch }}" ] || [ -z "${{ inputs.nightly-url }}" ]; then | ||
| echo "Error: branch and nightly-url are required for nightly mode" | ||
| exit 1 | ||
| fi | ||
| ;; | ||
| build) | ||
| if [ -z "${{ inputs.commit-id }}" ] || [ -z "${{ inputs.event-key }}" ]; then | ||
| echo "Error: commit-id and event-key are required for build mode" | ||
| exit 1 | ||
| fi | ||
| ;; | ||
| fixed) | ||
| if [ -z "${{ inputs.package-path }}" ]; then | ||
| echo "Error: package-path is required for fixed mode" | ||
| exit 1 | ||
| fi | ||
| ;; | ||
| *) | ||
| echo "Error: mode must be one of [nightly, build, fixed]" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| - name: Setup nightly build | ||
| if: inputs.mode == 'nightly' | ||
| id: setup-nightly | ||
| shell: bash | ||
| run: | | ||
| echo "Downloading TDengine nightly for branch: ${{ inputs.branch }}" | ||
| set -o pipefail | ||
| if ! wget "${{ inputs.nightly-url }}/tsdb-nightly-${{ inputs.branch }}.tar.gz?v=$(date +%s)" \ | ||
| -O "tdengine-nightly.tar.gz" 2>&1 | tail -n5; then | ||
| echo "Error: failed to download nightly package" | ||
| exit 1 | ||
| fi | ||
|
huskar-t marked this conversation as resolved.
|
||
| echo "package_path=tdengine-nightly.tar.gz" >> $GITHUB_OUTPUT | ||
| echo "package_type=tar.gz" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Restore build cache | ||
| if: inputs.mode == 'build' | ||
| id: cache-server | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: server.tar.gz | ||
| key: ${{ runner.os }}-build-${{ inputs.event-key }}-${{ inputs.commit-id }} | ||
|
|
||
| - name: Setup build mode paths | ||
| if: inputs.mode == 'build' | ||
| id: setup-build | ||
| shell: bash | ||
| run: | | ||
| echo "package_path=server.tar.gz" >> $GITHUB_OUTPUT | ||
| echo "package_type=tar.gz" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Setup fixed mode paths | ||
| if: inputs.mode == 'fixed' | ||
| id: setup-fixed | ||
| shell: bash | ||
| run: | | ||
| package_path="${{ inputs.package-path }}" | ||
| if [ -d "$package_path" ]; then | ||
| package_type="dir" | ||
| elif [ -f "$package_path" ]; then | ||
| package_type="tar.gz" | ||
| else | ||
| echo "Error: package-path not found or inaccessible: $package_path" | ||
| exit 1 | ||
| fi | ||
| echo "package_path=$package_path" >> $GITHUB_OUTPUT | ||
| echo "package_type=$package_type" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Determine package info | ||
| id: package-info | ||
| shell: bash | ||
| run: | | ||
| if [ "${{ inputs.mode }}" == "nightly" ]; then | ||
| echo "path=${{ steps.setup-nightly.outputs.package_path }}" >> $GITHUB_OUTPUT | ||
| echo "type=${{ steps.setup-nightly.outputs.package_type }}" >> $GITHUB_OUTPUT | ||
| elif [ "${{ inputs.mode }}" == "build" ]; then | ||
| echo "path=${{ steps.setup-build.outputs.package_path }}" >> $GITHUB_OUTPUT | ||
| echo "type=${{ steps.setup-build.outputs.package_type }}" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "path=${{ steps.setup-fixed.outputs.package_path }}" >> $GITHUB_OUTPUT | ||
| echo "type=${{ steps.setup-fixed.outputs.package_type }}" >> $GITHUB_OUTPUT | ||
| fi | ||
|
huskar-t marked this conversation as resolved.
|
||
|
|
||
| - name: Install and setup TDengine | ||
| uses: ./.github/actions/setup-tdengine-base | ||
| with: | ||
| install-package: ${{ steps.package-info.outputs.path }} | ||
| package-type: ${{ steps.package-info.outputs.type }} | ||
| install-args: ${{ inputs.install-args }} | ||
| start-services: ${{ inputs.start-services }} | ||
| config-files: ${{ inputs.config-files }} | ||
| version: ${{ inputs.version }} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.