diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-05-28 07:36:07 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-05-28 07:36:07 -0700 |
commit | d1369aa134e8eaab1bde6a5ea36a8ba655c79a57 (patch) | |
tree | c1cdc85da9e4a01371edee5dcb99a6069f0c5be8 /src/core/iomgr | |
parent | fe46136721acc3298a2949a7321d043180daed92 (diff) | |
parent | a3c9fb08136d6a3875b8e400ef4b4137357d6b4a (diff) |
Merge github.com:grpc/grpc into scalable-poll
Diffstat (limited to 'src/core/iomgr')
-rw-r--r-- | src/core/iomgr/pollset_posix.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index bdfcba6e5d..a38517908d 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -174,6 +174,8 @@ void grpc_pollset_del_fd(grpc_pollset *pollset, grpc_fd *fd) { int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) { /* pollset->mu already held */ gpr_timespec now = gpr_now(); + /* FIXME(ctiller): see below */ + gpr_timespec maximum_deadline = gpr_time_add(now, gpr_time_from_seconds(1)); int r; if (gpr_time_cmp(now, deadline) > 0) { return 0; @@ -184,6 +186,11 @@ int grpc_pollset_work(grpc_pollset *pollset, gpr_timespec deadline) { if (grpc_alarm_check(&pollset->mu, now, &deadline)) { return 1; } + /* FIXME(ctiller): we should not clamp deadline, however we have some + stuck at shutdown bugs that this resolves */ + if (gpr_time_cmp(deadline, maximum_deadline) > 0) { + deadline = maximum_deadline; + } gpr_tls_set(&g_current_thread_poller, (gpr_intptr)pollset); r = pollset->vtable->maybe_work(pollset, deadline, now, 1); gpr_tls_set(&g_current_thread_poller, 0); |