veyron2/context: Allow users to remove cancellation and deadlines from contexts.
Also remove the previous hack that prevented unmounting from being canceled.
Change-Id: I23ec4f1441de9a0b74f72df80ca84b86f4d000ff
diff --git a/runtimes/google/ipc/client.go b/runtimes/google/ipc/client.go
index c0d41df..5f53bc8 100644
--- a/runtimes/google/ipc/client.go
+++ b/runtimes/google/ipc/client.go
@@ -296,15 +296,6 @@
return
}
-func allowCancel(opts []ipc.CallOpt) bool {
- for _, o := range opts {
- if _, ok := o.(inaming.NoCancel); ok {
- return false
- }
- }
- return true
-}
-
func mkDischargeImpetus(serverBlessings []string, method string, args []interface{}) security.DischargeImpetus {
var impetus security.DischargeImpetus
if len(serverBlessings) > 0 {
@@ -500,10 +491,7 @@
continue
}
- var doneChan <-chan struct{}
- if allowCancel(opts) {
- doneChan = ctx.Done()
- }
+ doneChan := ctx.Done()
r.flow.SetDeadline(doneChan)
var (