Commit 449a4f2
committed
Address PR #321 review comments: Fix ExecContext telemetry timing and CloseOperation error tracking
This commit addresses two key review comments from @vikrantpuppala on PR #321:
1. **ExecContext timing fix**: Capture execution start time BEFORE running query
- Now captures `executeStart := time.Now()` before `runQuery()` call
- Uses `BeforeExecuteWithTime()` with pre-captured timestamp
- Matches the pattern already implemented in QueryContext
- Ensures telemetry accurately measures actual query execution time
2. **CloseOperation error tracking**: Capture cleanup errors in telemetry
- Added `closeOpErr` variable to track CloseOperation failures
- Includes CloseOperation errors in telemetry's deferred function
- Provides observability for resource cleanup issues
- Operation still returns success to caller (cleanup is best-effort)
These changes ensure telemetry captures the complete statement lifecycle,
including both execution timing and cleanup operations, without impacting
the caller's error handling semantics.
Co-authored-by: Isaac1 parent d24f896 commit 449a4f2
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| |||
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
138 | | - | |
| 140 | + | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| |||
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| 155 | + | |
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
| |||
0 commit comments