grpc 1.57.0.pre1-x86-linux → 1.58.0.pre1-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/ruby/ext/grpc/rb_channel.c +1 -53
- data/src/ruby/lib/grpc/2.6/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.7/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/3.0/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/3.1/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/3.2/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/generic/active_call.rb +9 -14
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/test/client.rb +16 -0
- data/src/ruby/spec/generic/rpc_server_spec.rb +3 -3
- metadata +7 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7ca6fa755d6552ffe687210b66012ac68e3872471de28308c7bd5b64684f440
|
4
|
+
data.tar.gz: 500bee47d7db839b79b8447f613c58fe2da83b8cd1cf68b6e1ee4e2bd71ad75a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de3ab771d4ee4d7fc8c8b33ac7d172e54d4d9e3b00e4057be03d4e43657ce1123768ee1ce83d1634befcac258483386c8547e9ec0b6d366d9f84edba2270a11a
|
7
|
+
data.tar.gz: 3fdbaf05f4f7ea91620a15eff65db3ae15087044913d7e5ab69a53a48c162f7874b72b0538f0fb1d84d70b75b6db6078e08046121b37e69965ab2d720f86eddc
|
@@ -97,8 +97,6 @@ static bg_watched_channel* bg_watched_channel_list_head = NULL;
|
|
97
97
|
|
98
98
|
static void grpc_rb_channel_try_register_connection_polling(
|
99
99
|
bg_watched_channel* bg);
|
100
|
-
static void* wait_until_channel_polling_thread_started_no_gil(void*);
|
101
|
-
static void wait_until_channel_polling_thread_started_unblocking_func(void*);
|
102
100
|
static void* channel_init_try_register_connection_polling_without_gil(
|
103
101
|
void* arg);
|
104
102
|
|
@@ -111,7 +109,6 @@ static grpc_completion_queue* g_channel_polling_cq;
|
|
111
109
|
static gpr_mu global_connection_polling_mu;
|
112
110
|
static gpr_cv global_connection_polling_cv;
|
113
111
|
static int g_abort_channel_polling = 0;
|
114
|
-
static int g_channel_polling_thread_started = 0;
|
115
112
|
static gpr_once g_once_init = GPR_ONCE_INIT;
|
116
113
|
static VALUE g_channel_polling_thread = Qnil;
|
117
114
|
|
@@ -224,12 +221,6 @@ static VALUE grpc_rb_channel_init(int argc, VALUE* argv, VALUE self) {
|
|
224
221
|
channel_init_try_register_stack stack;
|
225
222
|
|
226
223
|
grpc_ruby_fork_guard();
|
227
|
-
int stop_waiting_for_thread_start = 0;
|
228
|
-
rb_thread_call_without_gvl(
|
229
|
-
wait_until_channel_polling_thread_started_no_gil,
|
230
|
-
&stop_waiting_for_thread_start,
|
231
|
-
wait_until_channel_polling_thread_started_unblocking_func,
|
232
|
-
&stop_waiting_for_thread_start);
|
233
224
|
/* "3" == 3 mandatory args */
|
234
225
|
rb_scan_args(argc, argv, "3", &target, &channel_args, &credentials);
|
235
226
|
|
@@ -286,7 +277,6 @@ static void* get_state_without_gil(void* arg) {
|
|
286
277
|
get_state_stack* stack = (get_state_stack*)arg;
|
287
278
|
|
288
279
|
gpr_mu_lock(&global_connection_polling_mu);
|
289
|
-
GPR_ASSERT(g_abort_channel_polling || g_channel_polling_thread_started);
|
290
280
|
if (stack->bg->channel_destroyed) {
|
291
281
|
stack->out = GRPC_CHANNEL_SHUTDOWN;
|
292
282
|
} else {
|
@@ -423,15 +413,8 @@ static void grpc_rb_channel_maybe_recreate_channel_after_fork(
|
|
423
413
|
bg_watched_channel* bg = wrapper->bg_wrapped;
|
424
414
|
if (bg->channel_destroyed) {
|
425
415
|
// There must be one ref at this point, held by the ruby-level channel
|
426
|
-
// object.
|
416
|
+
// object, drop this one here.
|
427
417
|
GPR_ASSERT(bg->refcount == 1);
|
428
|
-
// Wait for channel polling thread to re-initialize
|
429
|
-
int stop_waiting_for_thread_start = 0;
|
430
|
-
rb_thread_call_without_gvl(
|
431
|
-
wait_until_channel_polling_thread_started_no_gil,
|
432
|
-
&stop_waiting_for_thread_start,
|
433
|
-
wait_until_channel_polling_thread_started_unblocking_func,
|
434
|
-
&stop_waiting_for_thread_start);
|
435
418
|
rb_thread_call_without_gvl(channel_safe_destroy_without_gil, bg, NULL,
|
436
419
|
NULL);
|
437
420
|
// re-create C-core channel
|
@@ -635,9 +618,6 @@ static void grpc_rb_channel_try_register_connection_polling(
|
|
635
618
|
bg_watched_channel* bg) {
|
636
619
|
grpc_connectivity_state conn_state;
|
637
620
|
watch_state_op* op = NULL;
|
638
|
-
|
639
|
-
GPR_ASSERT(g_channel_polling_thread_started || g_abort_channel_polling);
|
640
|
-
|
641
621
|
if (bg->refcount == 0) {
|
642
622
|
GPR_ASSERT(bg->channel_destroyed);
|
643
623
|
bg_watched_channel_list_free_and_remove(bg);
|
@@ -647,7 +627,6 @@ static void grpc_rb_channel_try_register_connection_polling(
|
|
647
627
|
if (bg->channel_destroyed || g_abort_channel_polling) {
|
648
628
|
return;
|
649
629
|
}
|
650
|
-
|
651
630
|
conn_state = grpc_channel_check_connectivity_state(bg->channel, 0);
|
652
631
|
if (conn_state == GRPC_CHANNEL_SHUTDOWN) {
|
653
632
|
return;
|
@@ -655,7 +634,6 @@ static void grpc_rb_channel_try_register_connection_polling(
|
|
655
634
|
GPR_ASSERT(bg_watched_channel_list_lookup(bg));
|
656
635
|
// prevent bg from being free'd by GC while background thread is watching it
|
657
636
|
bg->refcount++;
|
658
|
-
|
659
637
|
op = gpr_zalloc(sizeof(watch_state_op));
|
660
638
|
op->op_type = CONTINUOUS_WATCH;
|
661
639
|
op->op.continuous_watch_callback_args.bg = bg;
|
@@ -678,9 +656,6 @@ static void* run_poll_channels_loop_no_gil(void* arg) {
|
|
678
656
|
gpr_log(GPR_DEBUG, "GRPC_RUBY: run_poll_channels_loop_no_gil - begin");
|
679
657
|
|
680
658
|
gpr_mu_lock(&global_connection_polling_mu);
|
681
|
-
GPR_ASSERT(!g_abort_channel_polling);
|
682
|
-
GPR_ASSERT(!g_channel_polling_thread_started);
|
683
|
-
g_channel_polling_thread_started = 1;
|
684
659
|
gpr_cv_broadcast(&global_connection_polling_cv);
|
685
660
|
gpr_mu_unlock(&global_connection_polling_mu);
|
686
661
|
|
@@ -761,31 +736,6 @@ static VALUE run_poll_channels_loop(VALUE arg) {
|
|
761
736
|
return Qnil;
|
762
737
|
}
|
763
738
|
|
764
|
-
static void* wait_until_channel_polling_thread_started_no_gil(void* arg) {
|
765
|
-
int* stop_waiting = (int*)arg;
|
766
|
-
gpr_log(GPR_DEBUG, "GRPC_RUBY: wait for channel polling thread to start");
|
767
|
-
gpr_mu_lock(&global_connection_polling_mu);
|
768
|
-
while (!g_channel_polling_thread_started && !g_abort_channel_polling &&
|
769
|
-
!*stop_waiting) {
|
770
|
-
gpr_cv_wait(&global_connection_polling_cv, &global_connection_polling_mu,
|
771
|
-
gpr_inf_future(GPR_CLOCK_REALTIME));
|
772
|
-
}
|
773
|
-
gpr_mu_unlock(&global_connection_polling_mu);
|
774
|
-
|
775
|
-
return NULL;
|
776
|
-
}
|
777
|
-
|
778
|
-
static void wait_until_channel_polling_thread_started_unblocking_func(
|
779
|
-
void* arg) {
|
780
|
-
int* stop_waiting = (int*)arg;
|
781
|
-
gpr_mu_lock(&global_connection_polling_mu);
|
782
|
-
gpr_log(GPR_DEBUG,
|
783
|
-
"GRPC_RUBY: interrupt wait for channel polling thread to start");
|
784
|
-
*stop_waiting = 1;
|
785
|
-
gpr_cv_broadcast(&global_connection_polling_cv);
|
786
|
-
gpr_mu_unlock(&global_connection_polling_mu);
|
787
|
-
}
|
788
|
-
|
789
739
|
static void* set_abort_channel_polling_without_gil(void* arg) {
|
790
740
|
(void)arg;
|
791
741
|
gpr_mu_lock(&global_connection_polling_mu);
|
@@ -814,7 +764,6 @@ void grpc_rb_channel_polling_thread_start() {
|
|
814
764
|
gpr_once_init(&g_once_init, do_basic_init);
|
815
765
|
GPR_ASSERT(!RTEST(g_channel_polling_thread));
|
816
766
|
GPR_ASSERT(!g_abort_channel_polling);
|
817
|
-
GPR_ASSERT(!g_channel_polling_thread_started);
|
818
767
|
GPR_ASSERT(g_channel_polling_cq == NULL);
|
819
768
|
|
820
769
|
g_channel_polling_cq = grpc_completion_queue_create_for_next(NULL);
|
@@ -841,7 +790,6 @@ void grpc_rb_channel_polling_thread_stop() {
|
|
841
790
|
// we can start again later
|
842
791
|
g_channel_polling_thread = Qnil;
|
843
792
|
g_abort_channel_polling = false;
|
844
|
-
g_channel_polling_thread_started = false;
|
845
793
|
g_channel_polling_cq = NULL;
|
846
794
|
}
|
847
795
|
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -232,17 +232,16 @@ module GRPC
|
|
232
232
|
def server_unary_response(req, trailing_metadata: {},
|
233
233
|
code: Core::StatusCodes::OK, details: 'OK')
|
234
234
|
ops = {}
|
235
|
+
ops[SEND_MESSAGE] = @marshal.call(req)
|
236
|
+
ops[SEND_STATUS_FROM_SERVER] = Struct::Status.new(
|
237
|
+
code, details, trailing_metadata)
|
238
|
+
ops[RECV_CLOSE_ON_SERVER] = nil
|
239
|
+
|
235
240
|
@send_initial_md_mutex.synchronize do
|
236
241
|
ops[SEND_INITIAL_METADATA] = @metadata_to_send unless @metadata_sent
|
237
242
|
@metadata_sent = true
|
238
243
|
end
|
239
244
|
|
240
|
-
payload = @marshal.call(req)
|
241
|
-
ops[SEND_MESSAGE] = payload
|
242
|
-
ops[SEND_STATUS_FROM_SERVER] = Struct::Status.new(
|
243
|
-
code, details, trailing_metadata)
|
244
|
-
ops[RECV_CLOSE_ON_SERVER] = nil
|
245
|
-
|
246
245
|
@call.run_batch(ops)
|
247
246
|
set_output_stream_done
|
248
247
|
end
|
@@ -262,6 +261,9 @@ module GRPC
|
|
262
261
|
@metadata_received = true
|
263
262
|
end
|
264
263
|
get_message_from_batch_result(batch_result)
|
264
|
+
rescue GRPC::Core::CallError => e
|
265
|
+
GRPC.logger.info("remote_read: #{e}")
|
266
|
+
nil
|
265
267
|
end
|
266
268
|
|
267
269
|
def get_message_from_batch_result(recv_message_batch_result)
|
@@ -328,14 +330,7 @@ module GRPC
|
|
328
330
|
def each_remote_read_then_finish
|
329
331
|
return enum_for(:each_remote_read_then_finish) unless block_given?
|
330
332
|
loop do
|
331
|
-
resp =
|
332
|
-
begin
|
333
|
-
remote_read
|
334
|
-
rescue GRPC::Core::CallError => e
|
335
|
-
GRPC.logger.warn("In each_remote_read_then_finish: #{e}")
|
336
|
-
nil
|
337
|
-
end
|
338
|
-
|
333
|
+
resp = remote_read
|
339
334
|
break if resp.nil? # the last response was received
|
340
335
|
yield resp
|
341
336
|
end
|
data/src/ruby/pb/test/client.rb
CHANGED
@@ -649,6 +649,22 @@ class NamedTests
|
|
649
649
|
|
650
650
|
end
|
651
651
|
|
652
|
+
def special_status_message
|
653
|
+
code = GRPC::Core::StatusCodes::UNKNOWN
|
654
|
+
message = "\t\ntest with whitespace\r\nand Unicode BMP ☺ and non-BMP 😈\t\n"
|
655
|
+
req = SimpleRequest.new(
|
656
|
+
response_status: EchoStatus.new(code: code, message: message))
|
657
|
+
begin
|
658
|
+
resp = @stub.unary_call(req)
|
659
|
+
fail AssertionError, "GRPC::Unknown should have been raised."
|
660
|
+
rescue GRPC::Unknown => e
|
661
|
+
if e.details.force_encoding("UTF-8") != message
|
662
|
+
fail AssertionError,
|
663
|
+
"Expected message #{message}. Received: #{e.details}"
|
664
|
+
end
|
665
|
+
end
|
666
|
+
end
|
667
|
+
|
652
668
|
def all
|
653
669
|
all_methods = NamedTests.instance_methods(false).map(&:to_s)
|
654
670
|
all_methods.each do |m|
|
@@ -668,9 +668,9 @@ describe GRPC::RpcServer do
|
|
668
668
|
def check_multi_req_view_of_finished_call(call)
|
669
669
|
common_check_of_finished_server_call(call)
|
670
670
|
|
671
|
-
|
672
|
-
|
673
|
-
|
671
|
+
l = []
|
672
|
+
call.each_remote_read.each { |r| l << r }
|
673
|
+
expect(l.size).to eq(0)
|
674
674
|
end
|
675
675
|
|
676
676
|
def common_check_of_finished_server_call(call)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.58.0.pre1
|
5
5
|
platform: x86-linux
|
6
6
|
authors:
|
7
7
|
- gRPC Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: src/ruby/bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|
@@ -182,22 +182,16 @@ dependencies:
|
|
182
182
|
name: googleauth
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- - "
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: 0.5.1
|
188
|
-
- - "<"
|
185
|
+
- - "~>"
|
189
186
|
- !ruby/object:Gem::Version
|
190
|
-
version: '0
|
187
|
+
version: '1.0'
|
191
188
|
type: :development
|
192
189
|
prerelease: false
|
193
190
|
version_requirements: !ruby/object:Gem::Requirement
|
194
191
|
requirements:
|
195
|
-
- - "
|
196
|
-
- !ruby/object:Gem::Version
|
197
|
-
version: 0.5.1
|
198
|
-
- - "<"
|
192
|
+
- - "~>"
|
199
193
|
- !ruby/object:Gem::Version
|
200
|
-
version: '0
|
194
|
+
version: '1.0'
|
201
195
|
description: Send RPCs from Ruby using GRPC
|
202
196
|
email: grpc-io@googlegroups.com
|
203
197
|
executables: []
|
@@ -359,7 +353,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
359
353
|
- !ruby/object:Gem::Version
|
360
354
|
version: 1.3.1
|
361
355
|
requirements: []
|
362
|
-
rubygems_version: 3.4.
|
356
|
+
rubygems_version: 3.4.19
|
363
357
|
signing_key:
|
364
358
|
specification_version: 4
|
365
359
|
summary: GRPC system in Ruby
|