Commit 1236e7f
authored
Fix null statementID in telemetry logs + make thread daemon (#938)
## Description
- Currently telemetry wont be sent for cases where operationHandle is
not present, this PR fixes that. Example instance where our telemetry
would be useless : https://databricks.atlassian.net/browse/PECOBLR-359
- Also made telemetry client async : this avoids JVM to be alive even
after main program completes
## Testing
<!-- Describe how the changes have been tested-->
## Additional Notes to the Reviewer
The daemon introduces a known bug that will be fixed in a later PR
https://databricks.atlassian.net/browse/PECO-2716
- We have set the telemetry thread as daemon thread in JDBC. But, if the
connection is closed and program is ended, the thread may not be able to
send telemetry logs. There are 2 solutions discussed within the team on
this (but we would need benchmarking/ analyse the pros cons on this to
conclude) :
- Make close telemetry client flush sync in nature
- shutdown hook added to the executor
- A new HTTP Client may be created on the conn.close because HTTP Client
corresponding to the connectionContext is removed but the telemetry task
may not be complete by then(This will be resolved by fixing the above
issue 1.a. But we will have to finalize this too)
NO_CHANGELOG=true1 parent 8c44a07 commit 1236e7f
File tree
3 files changed
+10
-10
lines changed- src
- main/java/com/databricks/jdbc/telemetry
- test/java/com/databricks/jdbc/telemetry
3 files changed
+10
-10
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | 128 | | |
131 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | 171 | | |
177 | 172 | | |
178 | 173 | | |
| |||
0 commit comments