neo4j-ruby-driver 6.0.0.alpha.1 → 6.0.0.alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/neo4j/driver/exceptions/neo4j_exception.rb +6 -6
- data/ruby/neo4j/driver/internal/async/internal_async_session.rb +6 -12
- data/ruby/neo4j/driver/internal/handlers/routing_response_handler.rb +16 -7
- data/ruby/neo4j/driver/internal/internal_session.rb +2 -6
- data/ruby/neo4j/driver/internal/retry/exponential_backoff_retry_logic.rb +2 -3
- data/ruby/neo4j/driver/version.rb +1 -1
- metadata +8 -6
- data/ruby/neo4j/driver/internal/delegating_transaction.rb +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f3311d80f0443eeacf83a9d05717d4a4e1cea4e08ba835d9392d17ee5bfac612
|
|
4
|
+
data.tar.gz: 200b05e82cd52f7483265a9eeac22ba70a857db9ab5803fc05829a3732837579
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 00d3a5c75bd7a87226553ee7f0f88fd9e5ac0d06b9ebe768dddcd13aead8eec3c9d4e3d966b6fa0f670c28d84b1301cb2f2ee5e11aa1196448e00ccece428a1f
|
|
7
|
+
data.tar.gz: f028bdd152fe36030a18a261e7d0614d8f6ed97a10b798e5cf7a1ae426c73aca0750e6da4cb5deb2c7f8b0cc9f07b3c336ed70cc47941b659e73f83a753011a5
|
|
@@ -7,14 +7,14 @@ module Neo4j
|
|
|
7
7
|
attr_reader :code, :suppressed
|
|
8
8
|
|
|
9
9
|
def initialize(*args)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@
|
|
13
|
-
|
|
10
|
+
args, exceptions = args.partition { |arg| arg.is_a?(String) }
|
|
11
|
+
super(args.pop)
|
|
12
|
+
@code = args.pop
|
|
13
|
+
add_suppressed(*exceptions)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def add_suppressed(
|
|
17
|
-
(@suppressed ||= [])
|
|
16
|
+
def add_suppressed(*exceptions)
|
|
17
|
+
(@suppressed ||= []).concat(exceptions) if exceptions.any?
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -32,10 +32,8 @@ module Neo4j::Driver
|
|
|
32
32
|
tx_future = @session.begin_transaction_async(mode, ** config)
|
|
33
33
|
|
|
34
34
|
tx_future.when_complete do |tx, completion_error|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if !error.nil?
|
|
38
|
-
result_future.complete_exceptionally(error)
|
|
35
|
+
if completion_error
|
|
36
|
+
result_future.complete_exceptionally(completion_error)
|
|
39
37
|
else
|
|
40
38
|
execute_work(result_future, tx, &work)
|
|
41
39
|
end
|
|
@@ -48,10 +46,8 @@ module Neo4j::Driver
|
|
|
48
46
|
work_future = safe_execute_work(tx, &work)
|
|
49
47
|
|
|
50
48
|
work_future.when_complete do |result, completion_error|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if !error.nil?
|
|
54
|
-
close_tx_after_failed_transaction_work(tx, result_future, error)
|
|
49
|
+
if completion_error
|
|
50
|
+
close_tx_after_failed_transaction_work(tx, result_future, completion_error)
|
|
55
51
|
else
|
|
56
52
|
close_tx_after_succeeded_transaction_work(tx, result_future, result)
|
|
57
53
|
end
|
|
@@ -83,10 +79,8 @@ module Neo4j::Driver
|
|
|
83
79
|
|
|
84
80
|
def close_tx_after_succeeded_transaction_work(tx, result_future, result)
|
|
85
81
|
tx.close_async(true).when_complete do |_ignored, completion_error|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if !commit_error.nil?
|
|
89
|
-
result_future.complete_exceptionally(commit_error)
|
|
82
|
+
if completion_error
|
|
83
|
+
result_future.complete_exceptionally(completion_error)
|
|
90
84
|
else
|
|
91
85
|
result_future.complete(result)
|
|
92
86
|
end
|
|
@@ -19,13 +19,12 @@ module Neo4j::Driver
|
|
|
19
19
|
|
|
20
20
|
private
|
|
21
21
|
|
|
22
|
-
def handled_error(
|
|
23
|
-
# TODO: probably not necessary with concurrent-ruby as it might not wrap exceptions like java
|
|
24
|
-
error = Futures.completion_exception_cause(received_error)
|
|
25
|
-
|
|
22
|
+
def handled_error(error)
|
|
26
23
|
case error
|
|
27
24
|
when Exceptions::ServiceUnavailableException
|
|
28
25
|
handled_service_unavailable_exception(error)
|
|
26
|
+
when Exceptions::ProtocolException
|
|
27
|
+
handled_protocol_exception(error)
|
|
29
28
|
when Exceptions::ClientException
|
|
30
29
|
handled_client_exception(error)
|
|
31
30
|
when Exceptions::TransientException
|
|
@@ -36,12 +35,22 @@ module Neo4j::Driver
|
|
|
36
35
|
end
|
|
37
36
|
|
|
38
37
|
def handled_service_unavailable_exception(e)
|
|
39
|
-
|
|
40
|
-
Exceptions::SessionExpiredException("Server at #{@address} is no longer available", e)
|
|
38
|
+
record_connection_failure
|
|
39
|
+
Exceptions::SessionExpiredException.new("Server at #{@address} is no longer available", e)
|
|
41
40
|
end
|
|
42
41
|
|
|
43
42
|
def handled_transient_exception(e)
|
|
44
|
-
e.code == "Neo.TransientError.General.DatabaseUnavailable"
|
|
43
|
+
record_connection_failure if e.code == "Neo.TransientError.General.DatabaseUnavailable"
|
|
44
|
+
e
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def handled_protocol_exception(e)
|
|
48
|
+
record_connection_failure
|
|
49
|
+
e
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def record_connection_failure
|
|
53
|
+
@error_handler.on_connection_failure(@address)
|
|
45
54
|
end
|
|
46
55
|
|
|
47
56
|
def handled_client_exception(e)
|
|
@@ -48,19 +48,15 @@ module Neo4j::Driver
|
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def execute_read(**config, &block)
|
|
51
|
-
|
|
51
|
+
transaction(AccessMode::READ, **config, &block)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def execute_write(**config, &block)
|
|
55
|
-
|
|
55
|
+
transaction(AccessMode::WRITE, **config, &block)
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
private
|
|
59
59
|
|
|
60
|
-
def delegating_transaction(mode, **config, &block)
|
|
61
|
-
transaction(mode, **config) { |tx| block.call(DelegatingTransaction.new(tx)) }
|
|
62
|
-
end
|
|
63
|
-
|
|
64
60
|
def transaction(mode, **config)
|
|
65
61
|
# use different code path compared to async so that work is executed in the caller thread
|
|
66
62
|
# caller thread will also be the one who sleeps between retries;
|
|
@@ -92,10 +92,9 @@ module Neo4j::Driver
|
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
work_stage.on_resolution do |fulfilled, result, completion_error|
|
|
95
|
-
|
|
96
|
-
if error
|
|
95
|
+
if completion_error
|
|
97
96
|
# work failed in async way, attempt to schedule a retry
|
|
98
|
-
retry_on_error(result_future, work, start_time, retry_delay,
|
|
97
|
+
retry_on_error(result_future, work, start_time, retry_delay, completion_error, errors)
|
|
99
98
|
else
|
|
100
99
|
result_future.fulfill(result)
|
|
101
100
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: neo4j-ruby-driver
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.0.0.alpha.
|
|
4
|
+
version: 6.0.0.alpha.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Heinrich Klobuczek
|
|
@@ -217,7 +217,10 @@ dependencies:
|
|
|
217
217
|
- - "<"
|
|
218
218
|
- !ruby/object:Gem::Version
|
|
219
219
|
version: '8'
|
|
220
|
-
description:
|
|
220
|
+
description: |2
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
==== To Install:
|
|
221
224
|
email:
|
|
222
225
|
- heinrich@mail.com
|
|
223
226
|
executables: []
|
|
@@ -346,7 +349,6 @@ files:
|
|
|
346
349
|
- ruby/neo4j/driver/internal/database_name_util.rb
|
|
347
350
|
- ruby/neo4j/driver/internal/default_bookmark_holder.rb
|
|
348
351
|
- ruby/neo4j/driver/internal/default_domain_name_resolver.rb
|
|
349
|
-
- ruby/neo4j/driver/internal/delegating_transaction.rb
|
|
350
352
|
- ruby/neo4j/driver/internal/direct_connection_provider.rb
|
|
351
353
|
- ruby/neo4j/driver/internal/driver_factory.rb
|
|
352
354
|
- ruby/neo4j/driver/internal/eager_result_value.rb
|
|
@@ -526,14 +528,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
526
528
|
requirements:
|
|
527
529
|
- - ">="
|
|
528
530
|
- !ruby/object:Gem::Version
|
|
529
|
-
version: '3.
|
|
531
|
+
version: '3.4'
|
|
530
532
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
531
533
|
requirements:
|
|
532
534
|
- - ">="
|
|
533
535
|
- !ruby/object:Gem::Version
|
|
534
536
|
version: '0'
|
|
535
537
|
requirements: []
|
|
536
|
-
rubygems_version:
|
|
538
|
+
rubygems_version: 4.0.3
|
|
537
539
|
specification_version: 4
|
|
538
|
-
summary:
|
|
540
|
+
summary: "==== To Install:"
|
|
539
541
|
test_files: []
|