Skip to content

Commit 6f451bd

Browse files
CritasWangCopilot
andauthored
Fix SessionPool client leak on reconnection and query failures, and preserve server error messages (#44)
* Fix SessionPool client leak on reconnection and query failures, and preserve server error messages - Add SessionPoolDepletedException with diagnostic properties for pool depletion scenarios - Add ReconnectionFailedException for type-safe reconnection failure detection - Fix client leak when reconnection succeeds but retry operation fails - Add PoolHealthMetrics for thread-safe health monitoring - Add try-finally protection for Monitor locks in ConcurrentClientQueue - Remove silent failure pattern - always log connection failures - Add CurrentBatchRowCount() method with Obsolete attribute on RowCount() - Improve database switch error handling with partial failure detection * Update src/Apache.IoTDB/SessionPool.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * use try-finally for Return Client * Feature/dotnet format ci (#46) * switch to dotnet format * format --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 54545a5 commit 6f451bd

File tree

13 files changed

+825
-100
lines changed

13 files changed

+825
-100
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ indent_size = 2
3737
[*{_AssemblyInfo.cs,.notsupported.cs,*/obj/*/External/**/*,*/obj/dotnet-new.IntegrationTests/*/TemplatePackagesPaths.cs}]
3838
generated_code = true
3939

40+
# Thrift generated code
41+
[src/Apache.IoTDB/Rpc/Generated/**]
42+
generated_code = true
43+
4044
# C# files
4145
[*.cs]
4246
# New line preferences

.github/workflows/pre-commit-format.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ on:
77
- "**"
88
merge_group:
99
branches: [main]
10-
# schedule:
11-
# - cron: "0 0 * * *"
1210

1311
concurrency:
1412
group: ${{ github.workflow }}-${{ github.ref }}
1513
cancel-in-progress: true
1614

1715
jobs:
18-
formatting-checks:
16+
dotnet-format:
1917
runs-on: ubuntu-22.04
2018
env:
2119
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
@@ -29,27 +27,9 @@ jobs:
2927
with:
3028
dotnet-version: "9.0.x"
3129

32-
- name: Setup Python environment (for pre-commit)
33-
uses: actions/setup-python@v5
34-
with:
35-
python-version: "3.10"
36-
37-
- name: Clean dotnet temporary folder
38-
run: |
39-
sudo rm -rf /tmp/.dotnet
40-
mkdir -p ${{ runner.temp }}/dotnet-home
41-
mkdir -p ${{ runner.temp }}/xdg-runtime
42-
43-
- name: Install pre-commit and dependencies
44-
run: |
45-
pip install pre-commit
46-
pre-commit install-hooks
30+
- name: Restore dependencies
31+
run: dotnet restore
4732

48-
- name: Run pre-commit checks
49-
env:
50-
TMPDIR: ${{ runner.temp }}
51-
DOTNET_CLI_HOME: ${{ runner.temp }}/dotnet-home
52-
XDG_RUNTIME_DIR: ${{ runner.temp }}/xdg-runtime
53-
NUGET_PACKAGES: ${{ runner. temp }}/nuget-packages
33+
- name: Check formatting
5434
run: |
55-
pre-commit run --all-files
35+
dotnet format --verify-no-changes --verbosity diagnostic

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,23 @@ NLog >= 4.7.9
8282
* dotnet CLI
8383
* Thrift
8484

85+
## Code Formatting
86+
87+
This project uses `dotnet format` to enforce consistent code style based on the [.editorconfig](.editorconfig) rules.
88+
89+
### Check formatting locally
90+
91+
```bash
92+
dotnet format --verify-no-changes
93+
```
94+
95+
### Auto-fix formatting issues
96+
97+
```bash
98+
dotnet format
99+
```
100+
101+
The CI pipeline will automatically check code formatting on all pull requests. Please ensure your code is properly formatted before submitting a PR.
102+
85103
## Publish your own client on nuget.org
86104
You can find out how to publish from this [doc](./PUBLISH.md).

README_ZH.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,23 @@ NLog >= 4.7.9
8181
* dotnet CLI
8282
* Thrift
8383

84+
## 代码格式化
85+
86+
本项目使用 `dotnet format` 基于 [.editorconfig](.editorconfig) 规则来强制执行一致的代码风格。
87+
88+
### 本地检查格式
89+
90+
```bash
91+
dotnet format --verify-no-changes
92+
```
93+
94+
### 自动修复格式问题
95+
96+
```bash
97+
dotnet format
98+
```
99+
100+
CI 流水线会在所有 Pull Request 上自动检查代码格式。请确保在提交 PR 之前代码格式正确。
101+
84102
## 在 nuget.org 上发布你自己的客户端
85103
你可以在这个[文档](./PUBLISH.md)中找到如何发布

0 commit comments

Comments
 (0)