Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
7b3629e6
Commit
7b3629e6
authored
7 years ago
by
Alexander Polcyn
Browse files
Options
Downloads
Patches
Plain Diff
fix lack-of-abort bug
parent
0e2b6a21
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ruby/end2end/grpc_class_init_client.rb
+13
-3
13 additions, 3 deletions
src/ruby/end2end/grpc_class_init_client.rb
src/ruby/ext/grpc/rb_channel.c
+1
-11
1 addition, 11 deletions
src/ruby/ext/grpc/rb_channel.c
with
14 additions
and
14 deletions
src/ruby/end2end/grpc_class_init_client.rb
+
13
−
3
View file @
7b3629e6
...
@@ -106,9 +106,19 @@ def main
...
@@ -106,9 +106,19 @@ def main
return
return
end
end
thd
=
Thread
.
new
{
test_proc
.
call
}
# test_proc.call
test_proc
.
call
thd
.
join
thds
=
[]
100
.
times
do
thds
<<
Thread
.
new
do
test_proc
.
call
sleep
10
end
end
#test_proc.call
raise
"something"
thds
.
each
(
&
:join
)
end
end
main
main
This diff is collapsed.
Click to expand it.
src/ruby/ext/grpc/rb_channel.c
+
1
−
11
View file @
7b3629e6
...
@@ -107,7 +107,6 @@ bg_watched_channel *bg_watched_channel_list_head = NULL;
...
@@ -107,7 +107,6 @@ bg_watched_channel *bg_watched_channel_list_head = NULL;
void
grpc_rb_channel_try_register_connection_polling
(
bg_watched_channel
*
bg
);
void
grpc_rb_channel_try_register_connection_polling
(
bg_watched_channel
*
bg
);
void
*
wait_until_channel_polling_thread_started_no_gil
(
void
*
);
void
*
wait_until_channel_polling_thread_started_no_gil
(
void
*
);
void
wait_until_channel_polling_thread_started_unblocking_func
(
void
*
);
void
*
channel_init_try_register_connection_polling_without_gil
(
void
*
arg
);
void
*
channel_init_try_register_connection_polling_without_gil
(
void
*
arg
);
typedef
struct
channel_init_try_register_stack
{
typedef
struct
channel_init_try_register_stack
{
...
@@ -228,7 +227,7 @@ VALUE grpc_rb_channel_init(int argc, VALUE *argv, VALUE self) {
...
@@ -228,7 +227,7 @@ VALUE grpc_rb_channel_init(int argc, VALUE *argv, VALUE self) {
grpc_ruby_once_init
();
grpc_ruby_once_init
();
rb_thread_call_without_gvl
(
wait_until_channel_polling_thread_started_no_gil
,
NULL
,
rb_thread_call_without_gvl
(
wait_until_channel_polling_thread_started_no_gil
,
NULL
,
wait_until_channel_polling_thread_started
_unblocking_func
,
NULL
);
run_poll_channels_loop
_unblocking_func
,
NULL
);
/* "3" == 3 mandatory args */
/* "3" == 3 mandatory args */
rb_scan_args
(
argc
,
argv
,
"3"
,
&
target
,
&
channel_args
,
&
credentials
);
rb_scan_args
(
argc
,
argv
,
"3"
,
&
target
,
&
channel_args
,
&
credentials
);
...
@@ -685,15 +684,6 @@ void *wait_until_channel_polling_thread_started_no_gil(void *arg) {
...
@@ -685,15 +684,6 @@ void *wait_until_channel_polling_thread_started_no_gil(void *arg) {
return
NULL
;
return
NULL
;
}
}
void
wait_until_channel_polling_thread_started_unblocking_func
(
void
*
arg
)
{
(
void
)
arg
;
gpr_mu_lock
(
&
global_connection_polling_mu
);
gpr_log
(
GPR_DEBUG
,
"GRPC_RUBY: wait_until_channel_polling_thread_started_unblocking_func - begin aborting connection polling"
);
abort_channel_polling
=
1
;
gpr_cv_broadcast
(
&
global_connection_polling_cv
);
gpr_mu_unlock
(
&
global_connection_polling_mu
);
}
static
void
*
set_abort_channel_polling_without_gil
(
void
*
arg
)
{
static
void
*
set_abort_channel_polling_without_gil
(
void
*
arg
)
{
(
void
)
arg
;
(
void
)
arg
;
gpr_mu_lock
(
&
global_connection_polling_mu
);
gpr_mu_lock
(
&
global_connection_polling_mu
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment