File tree 2 files changed +10
-1
lines changed
main/java/org/springframework/data/neo4j/core/support
test/java/org/springframework/data/neo4j/core/support
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 22
22
import java .util .function .Predicate ;
23
23
24
24
import org .apiguardian .api .API ;
25
+ import org .neo4j .driver .exceptions .DiscoveryException ;
25
26
import org .neo4j .driver .exceptions .ServiceUnavailableException ;
26
27
import org .neo4j .driver .exceptions .SessionExpiredException ;
27
28
import org .neo4j .driver .exceptions .TransientException ;
@@ -60,7 +61,7 @@ public boolean test(Throwable throwable) {
60
61
return !("Neo.TransientError.Transaction.Terminated" .equals (code ) ||
61
62
"Neo.TransientError.Transaction.LockClientStopped" .equals (code ));
62
63
} else {
63
- return ex instanceof SessionExpiredException || ex instanceof ServiceUnavailableException ;
64
+ return ex instanceof SessionExpiredException || ex instanceof ServiceUnavailableException || ex instanceof DiscoveryException ;
64
65
}
65
66
}
66
67
}
Original file line number Diff line number Diff line change 21
21
import org .junit .jupiter .params .ParameterizedTest ;
22
22
import org .junit .jupiter .params .provider .ValueSource ;
23
23
import org .junit .platform .commons .util .ReflectionUtils ;
24
+ import org .neo4j .driver .exceptions .DiscoveryException ;
24
25
import org .neo4j .driver .exceptions .ServiceUnavailableException ;
25
26
import org .neo4j .driver .exceptions .SessionExpiredException ;
26
27
import org .springframework .dao .TransientDataAccessResourceException ;
@@ -48,6 +49,13 @@ void shouldNotRetryOnRandomIllegalStateExceptions() {
48
49
assertThat (predicate .test (new IllegalStateException ())).isFalse ();
49
50
}
50
51
52
+ @ Test // GH-2311
53
+ void shouldRetryDiscoveryExceptions () {
54
+
55
+ RetryExceptionPredicate predicate = new RetryExceptionPredicate ();
56
+ assertThat (predicate .test (new DiscoveryException ("Broken" , new RuntimeException ()))).isTrue ();
57
+ }
58
+
51
59
@ Test
52
60
void shouldPlayWellWithExceptionTranslator () {
53
61
You can’t perform that action at this time.
0 commit comments