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
5b48dea5
Commit
5b48dea5
authored
7 years ago
by
Yuchen Zeng
Browse files
Options
Downloads
Patches
Plain Diff
Fix fd_orphan in ev_epollsig_linux
parent
37691e73
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/lib/iomgr/ev_epollsig_linux.c
+12
-13
12 additions, 13 deletions
src/core/lib/iomgr/ev_epollsig_linux.c
with
12 additions
and
13 deletions
src/core/lib/iomgr/ev_epollsig_linux.c
+
12
−
13
View file @
5b48dea5
...
...
@@ -855,24 +855,12 @@ static int fd_wrapped_fd(grpc_fd *fd) {
static
void
fd_orphan
(
grpc_exec_ctx
*
exec_ctx
,
grpc_fd
*
fd
,
grpc_closure
*
on_done
,
int
*
release_fd
,
const
char
*
reason
)
{
bool
is_fd_closed
=
false
;
grpc_error
*
error
=
GRPC_ERROR_NONE
;
polling_island
*
unref_pi
=
NULL
;
gpr_mu_lock
(
&
fd
->
po
.
mu
);
fd
->
on_done_closure
=
on_done
;
/* If release_fd is not NULL, we should be relinquishing control of the file
descriptor fd->fd (but we still own the grpc_fd structure). */
if
(
release_fd
!=
NULL
)
{
*
release_fd
=
fd
->
fd
;
}
else
{
close
(
fd
->
fd
);
is_fd_closed
=
true
;
}
fd
->
orphaned
=
true
;
/* Remove the active status but keep referenced. We want this grpc_fd struct
to be alive (and not added to freelist) until the end of this function */
REF_BY
(
fd
,
1
,
reason
);
...
...
@@ -887,13 +875,24 @@ static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
before doing this.) */
if
(
fd
->
po
.
pi
!=
NULL
)
{
polling_island
*
pi_latest
=
polling_island_lock
(
fd
->
po
.
pi
);
polling_island_remove_fd_locked
(
pi_latest
,
fd
,
is_fd_closed
,
&
error
);
polling_island_remove_fd_locked
(
pi_latest
,
fd
,
false
/* is_fd_closed */
,
&
error
);
gpr_mu_unlock
(
&
pi_latest
->
mu
);
unref_pi
=
fd
->
po
.
pi
;
fd
->
po
.
pi
=
NULL
;
}
/* If release_fd is not NULL, we should be relinquishing control of the file
descriptor fd->fd (but we still own the grpc_fd structure). */
if
(
release_fd
!=
NULL
)
{
*
release_fd
=
fd
->
fd
;
}
else
{
close
(
fd
->
fd
);
}
fd
->
orphaned
=
true
;
GRPC_CLOSURE_SCHED
(
exec_ctx
,
fd
->
on_done_closure
,
GRPC_ERROR_REF
(
error
));
gpr_mu_unlock
(
&
fd
->
po
.
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