grpc 1.65.2-x86-mingw32 → 1.66.0.pre3-x86-mingw32

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cfbc9e9e51cae2b88e61d35d50efd40e6f4c702fafc19c5f34c78fa50d04ebe
4
- data.tar.gz: 2908072b264b28d7ed34949ee766b50fbe8fc419f6c06c3ab3feb576635d54ca
3
+ metadata.gz: 9ebe910b773b47d9ade3339975b295ad5d7520de0f9328b707832be056c7ef38
4
+ data.tar.gz: 28f4e84ecc5656db6ae12878d9a339c7cc7f1ac07f3558396e9f3ff7bfb7c81c
5
5
  SHA512:
6
- metadata.gz: 83e328e5d85ccaec94038a0fd8fe849ec44907690bf6cd31e60696ca8caba4570d803acf9bf3e00c22ee2b8fa5004185d8c29ab9928ae4ceee5a47b173453167
7
- data.tar.gz: 652d790bf7e10c30cfc88e6a5549dcde97a65f337c7758b1ee4a3d4e7e5148eeca3250bb97794a7695725cb2ba7d8165713a47a55bc17402572cf82d747a3a52
6
+ metadata.gz: 52dfcbeb2ec86b88d0ee30c1e6ce3b75edfa389ae6da5db4eadb3d4022aaa62988f8b73211b548883c765b9caac51f09a7e0934acbe51cdeb0945e2054a9a572
7
+ data.tar.gz: d4240db11fa61bd1de55794609a0d47ee3ea51e490c89f5ff9a15a3edbc479f1f489819e9658e23981eba988ac66b2119151f20399ba26ac6d61afb08a830f30
Binary file
@@ -437,7 +437,7 @@ static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) {
437
437
  tmp_str);
438
438
  return ST_STOP;
439
439
  }
440
- GPR_ASSERT(md_ary->count < md_ary->capacity);
440
+ GRPC_RUBY_ASSERT(md_ary->count < md_ary->capacity);
441
441
  md_ary->metadata[md_ary->count].key = key_slice;
442
442
  md_ary->metadata[md_ary->count].value = value_slice;
443
443
  md_ary->count += 1;
@@ -453,7 +453,7 @@ static int grpc_rb_md_ary_fill_hash_cb(VALUE key, VALUE val, VALUE md_ary_obj) {
453
453
  tmp_str);
454
454
  return ST_STOP;
455
455
  }
456
- GPR_ASSERT(md_ary->count < md_ary->capacity);
456
+ GRPC_RUBY_ASSERT(md_ary->count < md_ary->capacity);
457
457
  md_ary->metadata[md_ary->count].key = key_slice;
458
458
  md_ary->metadata[md_ary->count].value = value_slice;
459
459
  md_ary->count += 1;
@@ -123,7 +123,7 @@ static void* run_poll_channels_loop_unblocking_func_wrapper(void* arg);
123
123
  // Needs to be called under global_connection_polling_mu
124
124
  static void grpc_rb_channel_watch_connection_state_op_complete(
125
125
  watch_state_op* op, int success) {
126
- GPR_ASSERT(!op->op.api_callback_args.called_back);
126
+ GRPC_RUBY_ASSERT(!op->op.api_callback_args.called_back);
127
127
  op->op.api_callback_args.called_back = 1;
128
128
  op->op.api_callback_args.success = success;
129
129
  // wake up the watch API call that's waiting on this op
@@ -133,7 +133,7 @@ static void grpc_rb_channel_watch_connection_state_op_complete(
133
133
  /* Avoids destroying a channel twice. */
134
134
  static void grpc_rb_channel_safe_destroy(bg_watched_channel* bg) {
135
135
  gpr_mu_lock(&global_connection_polling_mu);
136
- GPR_ASSERT(bg_watched_channel_list_lookup(bg));
136
+ GRPC_RUBY_ASSERT(bg_watched_channel_list_lookup(bg));
137
137
  if (!bg->channel_destroyed) {
138
138
  grpc_channel_destroy(bg->channel);
139
139
  bg->channel_destroyed = 1;
@@ -253,7 +253,7 @@ static VALUE grpc_rb_channel_init(int argc, VALUE* argv, VALUE self) {
253
253
  ch = grpc_channel_create(target_chars, creds, &wrapper->args);
254
254
  }
255
255
 
256
- GPR_ASSERT(ch);
256
+ GRPC_RUBY_ASSERT(ch);
257
257
  stack.channel = ch;
258
258
  stack.wrapper = wrapper;
259
259
  rb_thread_call_without_gvl(
@@ -416,7 +416,7 @@ static void grpc_rb_channel_maybe_recreate_channel_after_fork(
416
416
  if (bg->channel_destroyed) {
417
417
  // There must be one ref at this point, held by the ruby-level channel
418
418
  // object, drop this one here.
419
- GPR_ASSERT(bg->refcount == 1);
419
+ GRPC_RUBY_ASSERT(bg->refcount == 1);
420
420
  rb_thread_call_without_gvl(channel_safe_destroy_without_gil, bg, NULL,
421
421
  NULL);
422
422
  // re-create C-core channel
@@ -581,8 +581,8 @@ static void bg_watched_channel_list_free_and_remove(
581
581
  bg_watched_channel* target) {
582
582
  bg_watched_channel* bg = NULL;
583
583
 
584
- GPR_ASSERT(bg_watched_channel_list_lookup(target));
585
- GPR_ASSERT(target->channel_destroyed && target->refcount == 0);
584
+ GRPC_RUBY_ASSERT(bg_watched_channel_list_lookup(target));
585
+ GRPC_RUBY_ASSERT(target->channel_destroyed && target->refcount == 0);
586
586
  if (bg_watched_channel_list_head == target) {
587
587
  bg_watched_channel_list_head = target->next;
588
588
  gpr_free(target);
@@ -597,7 +597,7 @@ static void bg_watched_channel_list_free_and_remove(
597
597
  }
598
598
  bg = bg->next;
599
599
  }
600
- GPR_ASSERT(0);
600
+ GRPC_RUBY_ASSERT(0);
601
601
  }
602
602
 
603
603
  /* Initialize a grpc_rb_channel's "protected grpc_channel" and try to push
@@ -621,11 +621,11 @@ static void grpc_rb_channel_try_register_connection_polling(
621
621
  grpc_connectivity_state conn_state;
622
622
  watch_state_op* op = NULL;
623
623
  if (bg->refcount == 0) {
624
- GPR_ASSERT(bg->channel_destroyed);
624
+ GRPC_RUBY_ASSERT(bg->channel_destroyed);
625
625
  bg_watched_channel_list_free_and_remove(bg);
626
626
  return;
627
627
  }
628
- GPR_ASSERT(bg->refcount == 1);
628
+ GRPC_RUBY_ASSERT(bg->refcount == 1);
629
629
  if (bg->channel_destroyed || g_abort_channel_polling) {
630
630
  return;
631
631
  }
@@ -633,7 +633,7 @@ static void grpc_rb_channel_try_register_connection_polling(
633
633
  if (conn_state == GRPC_CHANNEL_SHUTDOWN) {
634
634
  return;
635
635
  }
636
- GPR_ASSERT(bg_watched_channel_list_lookup(bg));
636
+ GRPC_RUBY_ASSERT(bg_watched_channel_list_lookup(bg));
637
637
  // prevent bg from being free'd by GC while background thread is watching it
638
638
  bg->refcount++;
639
639
  op = gpr_zalloc(sizeof(watch_state_op));
@@ -679,7 +679,7 @@ static void* run_poll_channels_loop_no_gil(void* arg) {
679
679
  grpc_rb_channel_watch_connection_state_op_complete(
680
680
  (watch_state_op*)event.tag, event.success);
681
681
  } else {
682
- GPR_ASSERT(0);
682
+ GRPC_RUBY_ASSERT(0);
683
683
  }
684
684
  }
685
685
  gpr_mu_unlock(&global_connection_polling_mu);
@@ -769,9 +769,9 @@ static void do_basic_init() {
769
769
  */
770
770
  void grpc_rb_channel_polling_thread_start() {
771
771
  gpr_once_init(&g_once_init, do_basic_init);
772
- GPR_ASSERT(!RTEST(g_channel_polling_thread));
773
- GPR_ASSERT(!g_abort_channel_polling);
774
- GPR_ASSERT(g_channel_polling_cq == NULL);
772
+ GRPC_RUBY_ASSERT(!RTEST(g_channel_polling_thread));
773
+ GRPC_RUBY_ASSERT(!g_abort_channel_polling);
774
+ GRPC_RUBY_ASSERT(g_channel_polling_cq == NULL);
775
775
 
776
776
  g_channel_polling_cq = grpc_completion_queue_create_for_next(NULL);
777
777
  g_channel_polling_thread = rb_thread_create(run_poll_channels_loop, NULL);
@@ -160,7 +160,7 @@ void grpc_rb_hash_convert_to_channel_args(VALUE src_hash,
160
160
  }
161
161
 
162
162
  void grpc_rb_channel_args_destroy(grpc_channel_args* args) {
163
- GPR_ASSERT(args != NULL);
163
+ GRPC_RUBY_ASSERT(args != NULL);
164
164
  if (args->args == NULL) return;
165
165
  for (int i = 0; i < args->num_args; i++) {
166
166
  // the key was created with gpr_strdup
@@ -181,9 +181,9 @@ void grpc_rb_compression_options_algorithm_name_to_value_internal(
181
181
  char* name_slice_str = grpc_slice_to_c_string(name_slice);
182
182
  char* error_message_str = NULL;
183
183
  VALUE error_message_ruby_str = Qnil;
184
- GPR_ASSERT(gpr_asprintf(&error_message_str,
185
- "Invalid compression algorithm name: %s",
186
- name_slice_str) != -1);
184
+ GRPC_RUBY_ASSERT(gpr_asprintf(&error_message_str,
185
+ "Invalid compression algorithm name: %s",
186
+ name_slice_str) != -1);
187
187
  gpr_free(name_slice_str);
188
188
  error_message_ruby_str =
189
189
  rb_str_new(error_message_str, strlen(error_message_str));
@@ -149,12 +149,12 @@ void grpc_rb_event_queue_thread_start() {
149
149
  event_queue.head = event_queue.tail = NULL;
150
150
  }
151
151
  event_queue.abort = false;
152
- GPR_ASSERT(!RTEST(g_event_thread));
152
+ GRPC_RUBY_ASSERT(!RTEST(g_event_thread));
153
153
  g_event_thread = rb_thread_create(grpc_rb_event_thread, NULL);
154
154
  }
155
155
 
156
156
  void grpc_rb_event_queue_thread_stop() {
157
- GPR_ASSERT(g_one_time_init_done);
157
+ GRPC_RUBY_ASSERT(g_one_time_init_done);
158
158
  if (!RTEST(g_event_thread)) {
159
159
  gpr_log(GPR_ERROR,
160
160
  "GRPC_RUBY: call credentials thread stop: thread not running");
@@ -248,12 +248,12 @@ static pid_t g_init_pid;
248
248
  static long g_init_tid;
249
249
 
250
250
  static bool grpc_ruby_initial_pid(void) {
251
- GPR_ASSERT(g_init_pid != 0);
251
+ GRPC_RUBY_ASSERT(g_init_pid != 0);
252
252
  return g_init_pid == getpid();
253
253
  }
254
254
 
255
255
  static bool grpc_ruby_initial_thread(void) {
256
- GPR_ASSERT(g_init_tid != 0);
256
+ GRPC_RUBY_ASSERT(g_init_tid != 0);
257
257
  return sys_gettid() == g_init_tid;
258
258
  }
259
259
 
@@ -263,8 +263,8 @@ static void grpc_ruby_reset_init_state(void) {
263
263
  }
264
264
 
265
265
  static void grpc_ruby_basic_init(void) {
266
- GPR_ASSERT(g_init_pid == 0);
267
- GPR_ASSERT(g_init_tid == 0);
266
+ GRPC_RUBY_ASSERT(g_init_pid == 0);
267
+ GRPC_RUBY_ASSERT(g_init_tid == 0);
268
268
  grpc_ruby_reset_init_state();
269
269
  // TODO(apolcyn): ideally, we should share logic with C-core
270
270
  // for determining whether or not fork support is enabled, rather
@@ -21,6 +21,8 @@
21
21
 
22
22
  #include <ruby/ruby.h>
23
23
 
24
+ #include <stdlib.h>
25
+
24
26
  #include <grpc/support/time.h>
25
27
 
26
28
  /* grpc_rb_mGrpcCore is the module containing the ruby wrapper GRPC classes. */
@@ -78,4 +80,10 @@ void grpc_rb_fork_unsafe_end();
78
80
 
79
81
  void grpc_ruby_init();
80
82
 
83
+ #define GRPC_RUBY_ASSERT(x) \
84
+ if (!(x)) { \
85
+ fprintf(stderr, "%s:%d assert failed\n", __FILE__, __LINE__); \
86
+ abort(); \
87
+ }
88
+
81
89
  #endif /* GRPC_RB_H_ */
@@ -253,14 +253,12 @@ gpr_malloc_aligned_type gpr_malloc_aligned_import;
253
253
  gpr_free_aligned_type gpr_free_aligned_import;
254
254
  gpr_cpu_num_cores_type gpr_cpu_num_cores_import;
255
255
  gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
256
- gpr_log_severity_string_type gpr_log_severity_string_import;
257
256
  gpr_log_type gpr_log_import;
258
257
  gpr_should_log_type gpr_should_log_import;
259
258
  gpr_log_message_type gpr_log_message_import;
260
259
  gpr_set_log_verbosity_type gpr_set_log_verbosity_import;
261
260
  gpr_log_verbosity_init_type gpr_log_verbosity_init_import;
262
261
  gpr_set_log_function_type gpr_set_log_function_import;
263
- gpr_assertion_failed_type gpr_assertion_failed_import;
264
262
  gpr_format_message_type gpr_format_message_import;
265
263
  gpr_strdup_type gpr_strdup_import;
266
264
  gpr_asprintf_type gpr_asprintf_import;
@@ -543,14 +541,12 @@ void grpc_rb_load_imports(HMODULE library) {
543
541
  gpr_free_aligned_import = (gpr_free_aligned_type) GetProcAddress(library, "gpr_free_aligned");
544
542
  gpr_cpu_num_cores_import = (gpr_cpu_num_cores_type) GetProcAddress(library, "gpr_cpu_num_cores");
545
543
  gpr_cpu_current_cpu_import = (gpr_cpu_current_cpu_type) GetProcAddress(library, "gpr_cpu_current_cpu");
546
- gpr_log_severity_string_import = (gpr_log_severity_string_type) GetProcAddress(library, "gpr_log_severity_string");
547
544
  gpr_log_import = (gpr_log_type) GetProcAddress(library, "gpr_log");
548
545
  gpr_should_log_import = (gpr_should_log_type) GetProcAddress(library, "gpr_should_log");
549
546
  gpr_log_message_import = (gpr_log_message_type) GetProcAddress(library, "gpr_log_message");
550
547
  gpr_set_log_verbosity_import = (gpr_set_log_verbosity_type) GetProcAddress(library, "gpr_set_log_verbosity");
551
548
  gpr_log_verbosity_init_import = (gpr_log_verbosity_init_type) GetProcAddress(library, "gpr_log_verbosity_init");
552
549
  gpr_set_log_function_import = (gpr_set_log_function_type) GetProcAddress(library, "gpr_set_log_function");
553
- gpr_assertion_failed_import = (gpr_assertion_failed_type) GetProcAddress(library, "gpr_assertion_failed");
554
550
  gpr_format_message_import = (gpr_format_message_type) GetProcAddress(library, "gpr_format_message");
555
551
  gpr_strdup_import = (gpr_strdup_type) GetProcAddress(library, "gpr_strdup");
556
552
  gpr_asprintf_import = (gpr_asprintf_type) GetProcAddress(library, "gpr_asprintf");
@@ -735,9 +735,6 @@ extern gpr_cpu_num_cores_type gpr_cpu_num_cores_import;
735
735
  typedef unsigned(*gpr_cpu_current_cpu_type)(void);
736
736
  extern gpr_cpu_current_cpu_type gpr_cpu_current_cpu_import;
737
737
  #define gpr_cpu_current_cpu gpr_cpu_current_cpu_import
738
- typedef const char*(*gpr_log_severity_string_type)(gpr_log_severity severity);
739
- extern gpr_log_severity_string_type gpr_log_severity_string_import;
740
- #define gpr_log_severity_string gpr_log_severity_string_import
741
738
  typedef void(*gpr_log_type)(const char* file, int line, gpr_log_severity severity, const char* format, ...) GPR_PRINT_FORMAT_CHECK(4, 5);
742
739
  extern gpr_log_type gpr_log_import;
743
740
  #define gpr_log gpr_log_import
@@ -756,9 +753,6 @@ extern gpr_log_verbosity_init_type gpr_log_verbosity_init_import;
756
753
  typedef void(*gpr_set_log_function_type)(gpr_log_func deprecated_setting);
757
754
  extern gpr_set_log_function_type gpr_set_log_function_import;
758
755
  #define gpr_set_log_function gpr_set_log_function_import
759
- typedef void(*gpr_assertion_failed_type)(const char* filename, int line, const char* message);
760
- extern gpr_assertion_failed_type gpr_assertion_failed_import;
761
- #define gpr_assertion_failed gpr_assertion_failed_import
762
756
  typedef char*(*gpr_format_message_type)(int messageid);
763
757
  extern gpr_format_message_type gpr_format_message_import;
764
758
  #define gpr_format_message gpr_format_message_import
@@ -193,7 +193,7 @@ struct server_request_call_args {
193
193
  static void shutdown_server_unblock_func(void* arg) {
194
194
  grpc_rb_server* server = (grpc_rb_server*)arg;
195
195
  gpr_log(GPR_INFO, "GRPC_RUBY: shutdown_server_unblock_func");
196
- GPR_ASSERT(server->wrapped != NULL);
196
+ GRPC_RUBY_ASSERT(server->wrapped != NULL);
197
197
  grpc_event event;
198
198
  void* tag = &event;
199
199
  grpc_server_shutdown_and_notify(server->wrapped, server->queue, tag);
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -14,6 +14,19 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
+ def self.logger=(logger_obj)
18
+ # Need a free variable here to keep value of logger_obj for logger closure
19
+ @logger = logger_obj
20
+
21
+ extend(
22
+ Module.new do
23
+ def logger
24
+ @logger
25
+ end
26
+ end
27
+ )
28
+ end
29
+
17
30
  # DefaultLogger is a module included in GRPC if no other logging is set up for
18
31
  # it. See ../spec/spec_helpers an example of where other logging is added.
19
32
  module DefaultLogger
@@ -14,5 +14,5 @@
14
14
 
15
15
  # GRPC contains the General RPC module.
16
16
  module GRPC
17
- VERSION = '1.65.2'
17
+ VERSION = '1.66.0.pre3'
18
18
  end
@@ -0,0 +1,30 @@
1
+ # Copyright 2024 gRPC authors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'spec_helper'
16
+ require 'logger'
17
+
18
+ describe GRPC do
19
+ describe '.logger=' do
20
+ it 'sets logger' do
21
+ noop_logger = GRPC::DefaultLogger::NoopLogger.new
22
+ GRPC.logger = noop_logger
23
+ expect(GRPC.logger).to be(noop_logger)
24
+
25
+ custom_logger = Logger.new(STDOUT)
26
+ GRPC.logger = custom_logger
27
+ expect(GRPC.logger).to be(custom_logger)
28
+ end
29
+ end
30
+ end
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.65.2
4
+ version: 1.66.0.pre3
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - gRPC Authors
8
8
  autorequire:
9
9
  bindir: src/ruby/bin
10
10
  cert_chain: []
11
- date: 2024-07-26 00:00:00.000000000 Z
11
+ date: 2024-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -313,6 +313,7 @@ files:
313
313
  - src/ruby/spec/generic/server_interceptors_spec.rb
314
314
  - src/ruby/spec/generic/service_spec.rb
315
315
  - src/ruby/spec/google_rpc_status_utils_spec.rb
316
+ - src/ruby/spec/logconfig_spec.rb
316
317
  - src/ruby/spec/pb/codegen/grpc/testing/package_options.proto
317
318
  - src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto
318
319
  - src/ruby/spec/pb/codegen/grpc/testing/package_options_import2.proto
@@ -359,7 +360,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
359
360
  - !ruby/object:Gem::Version
360
361
  version: '0'
361
362
  requirements: []
362
- rubygems_version: 3.5.16
363
+ rubygems_version: 3.5.17
363
364
  signing_key:
364
365
  specification_version: 4
365
366
  summary: GRPC system in Ruby
@@ -385,6 +386,7 @@ test_files:
385
386
  - src/ruby/spec/generic/server_interceptors_spec.rb
386
387
  - src/ruby/spec/generic/service_spec.rb
387
388
  - src/ruby/spec/google_rpc_status_utils_spec.rb
389
+ - src/ruby/spec/logconfig_spec.rb
388
390
  - src/ruby/spec/pb/codegen/grpc/testing/package_options.proto
389
391
  - src/ruby/spec/pb/codegen/grpc/testing/package_options_import.proto
390
392
  - src/ruby/spec/pb/codegen/grpc/testing/package_options_import2.proto