Commit 2630d40
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 c6e3b2a commit 2630d40
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | | - | |
| 140 | + | |
| 141 | + | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
143 | 151 | | |
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
| |||
156 | 165 | | |
157 | 166 | | |
158 | 167 | | |
| 168 | + | |
159 | 169 | | |
160 | 170 | | |
161 | 171 | | |
| |||
0 commit comments