Commit ead806e
authored
Add DNS Caching Phase 1 (#594)
This PR adds support for the upcoming DNS Caching feature on the server-side. There are two phases for this feature and this is the first phase support.
When using TCP protocol, the SqlClient driver will record the DNS information such as IP address and port number in an in-memory cache if the server sends back the corresponding TDS token for this caching. The DNS information will stay in the cache during the application lifetime unless the server tells the driver to clean the cache.
In phase 1, the IP and port number are from the DNS resolution during pre-login handshake. If the DNS server fails to resolve the server name, the driver will connect with its cached IP and port if they existed. Otherwise, the connection will fail.
Add support for both .NET Framework and .NET Core.
This change requires the corresponding change in native SNI.
The caching behavior is only for TCP connections.
Need to fail the DNS Server to test this behavior.1 parent 033541f commit ead806e
File tree
33 files changed
+1200
-73
lines changed- doc/snippets/Microsoft.Data.SqlClient
- src/Microsoft.Data.SqlClient
- netcore
- ref
- src
- Interop
- Microsoft/Data/SqlClient
- SNI
- netfx
- ref
- src
- Microsoft/Data
- Interop
- SqlClient
- src/Microsoft/Data/SqlClient
- tests
- FunctionalTests
- ManualTests
- DataCommon
- SQL/DNSCachingTest
- tools
- props
- specs
33 files changed
+1200
-73
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1055 | 1055 | | |
1056 | 1056 | | |
1057 | 1057 | | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
1058 | 1075 | | |
1059 | 1076 | | |
1060 | 1077 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
558 | 570 | | |
559 | 571 | | |
560 | 572 | | |
| |||
639 | 651 | | |
640 | 652 | | |
641 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
642 | 657 | | |
643 | 658 | | |
644 | 659 | | |
| |||
Lines changed: 67 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
162 | 165 | | |
163 | 166 | | |
164 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
165 | 182 | | |
166 | 183 | | |
167 | 184 | | |
| |||
236 | 253 | | |
237 | 254 | | |
238 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
239 | 265 | | |
240 | 266 | | |
241 | 267 | | |
| |||
248 | 274 | | |
249 | 275 | | |
250 | 276 | | |
251 | | - | |
| 277 | + | |
| 278 | + | |
252 | 279 | | |
253 | 280 | | |
254 | 281 | | |
| |||
283 | 310 | | |
284 | 311 | | |
285 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
286 | 338 | | |
287 | 339 | | |
288 | 340 | | |
289 | 341 | | |
290 | 342 | | |
291 | 343 | | |
292 | | - | |
| 344 | + | |
293 | 345 | | |
294 | 346 | | |
295 | 347 | | |
296 | 348 | | |
297 | 349 | | |
298 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
299 | 357 | | |
300 | 358 | | |
301 | | - | |
| 359 | + | |
302 | 360 | | |
303 | 361 | | |
304 | 362 | | |
| |||
321 | 379 | | |
322 | 380 | | |
323 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
324 | 387 | | |
325 | 388 | | |
326 | 389 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
150 | 153 | | |
151 | 154 | | |
152 | 155 | | |
| |||
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
266 | 268 | | |
267 | | - | |
| 269 | + | |
268 | 270 | | |
269 | 271 | | |
270 | 272 | | |
| |||
291 | 293 | | |
292 | 294 | | |
293 | 295 | | |
294 | | - | |
| 296 | + | |
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
| |||
373 | 375 | | |
374 | 376 | | |
375 | 377 | | |
| 378 | + | |
| 379 | + | |
376 | 380 | | |
377 | | - | |
| 381 | + | |
378 | 382 | | |
379 | 383 | | |
380 | 384 | | |
| |||
412 | 416 | | |
413 | 417 | | |
414 | 418 | | |
415 | | - | |
| 419 | + | |
416 | 420 | | |
417 | 421 | | |
418 | 422 | | |
| |||
0 commit comments