Commit 3f8ffaa
committed
3.x: fail fast on permanent keyspace setup failures
Keyspace setup during connection borrow used to treat every failed internal USE as a host or connection failure. That is correct for driver-side failures and transient server errors, but permanent validation errors such as a missing keyspace should fail the user request directly.
Report keyspace setup write failures through setKeyspaceAsync failed futures consistently, removing stale synchronous throws and caller catches. Reset failed keyspace attempts so later attempts are not blocked by stale in-flight state, and restore pool accounting when borrow-time setup fails.
Preserve QueryValidationException from internal USE without defuncting the connection, and have RequestHandler fail fast for those permanent errors. Keep internal driver failures and transient server-side errors on the normal next-host path before the user query is written, logging those pre-write host-attempt failures only at debug level.
Preserve the synchronous setKeyspace busy-connection behavior after async failures are reported through futures: BusyConnectionException is still converted to a non-defuncting ConnectionException, while ConnectionException keeps the previous defunct behavior.
Add focused coverage for defunct connections, pool accounting, permanent validation errors, transient server errors, retry-policy accounting, single-connection-pool next-host failover, and synchronous busy keyspace setup. Release test ByteBufs used to synthesize server errors.1 parent 9d45182 commit 3f8ffaa
4 files changed
Lines changed: 463 additions & 23 deletions
File tree
- driver-core/src
- main/java/com/datastax/driver/core
- test/java/com/datastax/driver/core
Lines changed: 32 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
845 | 846 | | |
846 | 847 | | |
847 | 848 | | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | 849 | | |
857 | 850 | | |
858 | | - | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
859 | 856 | | |
860 | 857 | | |
861 | 858 | | |
| |||
869 | 866 | | |
870 | 867 | | |
871 | 868 | | |
872 | | - | |
873 | | - | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
874 | 878 | | |
875 | 879 | | |
876 | 880 | | |
| |||
900 | 904 | | |
901 | 905 | | |
902 | 906 | | |
903 | | - | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
904 | 918 | | |
905 | 919 | | |
906 | 920 | | |
| |||
915 | 929 | | |
916 | 930 | | |
917 | 931 | | |
918 | | - | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
919 | 938 | | |
920 | 939 | | |
921 | 940 | | |
| |||
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
611 | 612 | | |
612 | 613 | | |
613 | 614 | | |
614 | | - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
615 | 631 | | |
616 | 632 | | |
617 | 633 | | |
| |||
Lines changed: 5 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
479 | 474 | | |
| 475 | + | |
480 | 476 | | |
481 | 477 | | |
482 | 478 | | |
| |||
0 commit comments