Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Retry Logic I - Statement Retry #2396

Merged
merged 62 commits into from
Sep 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
50f3f18
Trying on a new branch b/c I keep getting build failures and I have n…
Jeffery-Wasty Apr 15, 2024
74e007a
Adding back retryExec
Jeffery-Wasty Apr 15, 2024
726fc85
More
Jeffery-Wasty Apr 15, 2024
b463d81
Missing null check
Jeffery-Wasty Apr 17, 2024
1ffc13e
Next to final
Jeffery-Wasty Apr 22, 2024
d18b021
Removed mssql-jdbc.properties
Jeffery-Wasty Apr 22, 2024
5ff2737
Set up should start fresh + remove passwords to pass on pipeline
Jeffery-Wasty Apr 22, 2024
9b3863d
Minor cleanup
Jeffery-Wasty Apr 22, 2024
16e0224
Minor cleanup
Jeffery-Wasty Apr 22, 2024
632c168
Another missing null check
Jeffery-Wasty Apr 22, 2024
be55749
Fix for timeout tests
Jeffery-Wasty Apr 23, 2024
68c683a
Added timing tests + test comments
Jeffery-Wasty Apr 23, 2024
9730690
Formatting
Jeffery-Wasty Apr 23, 2024
d9d9b38
Added a multiple rules test
Jeffery-Wasty Apr 23, 2024
07fd965
Trying on a new branch b/c I keep getting build failures and I have n…
Jeffery-Wasty Apr 15, 2024
03aa1b7
More changes
Jeffery-Wasty Jun 7, 2024
83fecee
Undo LimitEscapeTest changes
Jeffery-Wasty Jun 7, 2024
1f3e891
Remove redundant files
Jeffery-Wasty Jun 7, 2024
e2b2bd0
Final?
Jeffery-Wasty Jun 10, 2024
2cb9650
Remove mssql-jdpc.properties file
Jeffery-Wasty Jun 10, 2024
4844288
sync --> lock
Jeffery-Wasty Jun 10, 2024
bb3b253
Remove problematic test
Jeffery-Wasty Jun 10, 2024
00c3545
Since error is unclear, try removing last test
Jeffery-Wasty Jun 10, 2024
1e79a1f
Adding back connection test
Jeffery-Wasty Jun 10, 2024
f8273ea
I need debugging
Jeffery-Wasty Jun 10, 2024
a74cffe
Fix for MI
Jeffery-Wasty Jun 10, 2024
5d80ecd
if condition for min time assertion
Jeffery-Wasty Jun 11, 2024
11e84cc
Leftover debug code, cleanup
Jeffery-Wasty Jun 13, 2024
141fc0c
Mistaken changes committed
Jeffery-Wasty Jun 13, 2024
9f24ce4
More liberal time windows
Jeffery-Wasty Jun 13, 2024
04aff85
Remove connection part
Jeffery-Wasty Jun 18, 2024
193620f
Missed some parts where connection retry was still included.
Jeffery-Wasty Jun 18, 2024
5e5858f
Forgot one more part
Jeffery-Wasty Jun 18, 2024
fdb38d8
Added (most) PR comment revisions.
Jeffery-Wasty Aug 11, 2024
6465a95
Add comments for specified and public facing methods
Jeffery-Wasty Aug 11, 2024
ff374b0
Merge branch 'main' into CRL2
Jeffery-Wasty Aug 11, 2024
46951f1
Added a missing test
Jeffery-Wasty Aug 12, 2024
eb1d508
Merge branch 'CRL2' of https://github.com/microsoft/mssql-jdbc into CRL2
Jeffery-Wasty Aug 12, 2024
0be2a3b
More tests
Jeffery-Wasty Aug 12, 2024
5d45f4d
Added more missing tests
Jeffery-Wasty Aug 13, 2024
cb24aa8
Resolve retryCount test failure
Jeffery-Wasty Aug 13, 2024
7634c39
Remove eaten exceptions
Jeffery-Wasty Aug 13, 2024
57fac74
Removed the file not found exception as we read for file in all cases…
Jeffery-Wasty Aug 13, 2024
151d40f
Added a proper file read
Jeffery-Wasty Aug 13, 2024
7aebfb2
Delete mssql-jdbc.properties
Jeffery-Wasty Aug 13, 2024
763144d
Added more coverage and minor fixes, ready for review again
Jeffery-Wasty Aug 14, 2024
cbdc239
Merge branch 'CRL2' of https://github.com/microsoft/mssql-jdbc into CRL2
Jeffery-Wasty Aug 14, 2024
7e267b1
Fixed read file test
Jeffery-Wasty Aug 14, 2024
a50fdf9
Addressed recent pr comments
Jeffery-Wasty Aug 15, 2024
728866d
Merge branch 'main' into CRL2
Jeffery-Wasty Aug 23, 2024
04c25f9
Remove double locking
Jeffery-Wasty Aug 23, 2024
c4e6153
Merge branch 'CRL2' of https://github.com/microsoft/mssql-jdbc into CRL2
Jeffery-Wasty Aug 23, 2024
c0fa29a
Remove unneeded variable
Jeffery-Wasty Aug 23, 2024
cc1540c
Revisions after PR review
Jeffery-Wasty Sep 18, 2024
9269c18
PR review update
Jeffery-Wasty Sep 19, 2024
bbcdf8d
Rename R_AKVURLInvalid as its use is no longer AKV specific
Jeffery-Wasty Sep 19, 2024
091ed78
Add back logging
Jeffery-Wasty Sep 20, 2024
9aa47ca
Typo
Jeffery-Wasty Sep 20, 2024
49b7b44
Removed unneeded comment
Jeffery-Wasty Sep 20, 2024
34cfa4b
Make static variables thread-safe
Jeffery-Wasty Sep 20, 2024
df67a98
Timing
Jeffery-Wasty Sep 20, 2024
7c7fc92
JavaDoc cleanup.
Jeffery-Wasty Sep 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;


/**
Expand All @@ -28,9 +30,10 @@
public class ConfigurableRetryLogic {
Jeffery-Wasty marked this conversation as resolved.
Show resolved Hide resolved
Jeffery-Wasty marked this conversation as resolved.
Show resolved Hide resolved
private final static int INTERVAL_BETWEEN_READS_IN_MS = 30000;
private final static String DEFAULT_PROPS_FILE = "mssql-jdbc.properties";
private static final Lock CRL_LOCK = new ReentrantLock();
private static final java.util.logging.Logger CONFIGURABLE_RETRY_LOGGER = java.util.logging.Logger
.getLogger("com.microsoft.sqlserver.jdbc.ConfigurableRetryLogic");
private static ConfigurableRetryLogic singleInstance = null;
private static ConfigurableRetryLogic singleInstance;
private static long timeLastModified;
Jeffery-Wasty marked this conversation as resolved.
Show resolved Hide resolved
private static long timeLastRead;
private static String lastQuery = ""; // The last query executed (used when rule is process-dependent)
Expand All @@ -56,12 +59,22 @@ private ConfigurableRetryLogic() throws SQLServerException {
* an exception
*/
public static ConfigurableRetryLogic getInstance() throws SQLServerException {
Jeffery-Wasty marked this conversation as resolved.
Show resolved Hide resolved
// No need for lock; static initializer singleInstance is thread-safe
// No need for lock; static initializer singleInstance is thread-safe]
Jeffery-Wasty marked this conversation as resolved.
Show resolved Hide resolved
if (singleInstance == null) {
singleInstance = new ConfigurableRetryLogic();
CRL_LOCK.lock();
try {
if (singleInstance == null) {
singleInstance = new ConfigurableRetryLogic();
} else {
refreshRuleSet();
}
} finally {
CRL_LOCK.unlock();
}
} else {
refreshRuleSet();
}

return singleInstance;
}

Expand Down
Loading