From e0448aed6b32f77e5c9eba14a351d23874affb2c Mon Sep 17 00:00:00 2001
From: Manish R Jain <manish@dgraph.io>
Date: Mon, 4 Jun 2018 16:01:38 -0700
Subject: [PATCH] some fixes

---
 worker/groups.go   | 2 +-
 worker/mutation.go | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/worker/groups.go b/worker/groups.go
index 72ee0370..be3b85b3 100644
--- a/worker/groups.go
+++ b/worker/groups.go
@@ -671,7 +671,7 @@ func (g *groupi) proposeDelta(oracleDelta *intern.OracleDelta) {
 	}
 
 	repeat := func(tctx *api.TxnContext) {
-		for i := 0; i < 3; i++ { // Try 3 times, then give up.
+		for i := 0; i < 1; i++ {
 			// TODO: This needs to be looked at carefully to figure out why does this fail.
 			err := g.Node.proposeAndWait(context.Background(), &intern.Proposal{TxnContext: tctx})
 			if err == nil {
diff --git a/worker/mutation.go b/worker/mutation.go
index f0c37935..d084976a 100644
--- a/worker/mutation.go
+++ b/worker/mutation.go
@@ -40,6 +40,9 @@ func deletePredicateEdge(edge *intern.DirectedEdge) bool {
 
 // runMutation goes through all the edges and applies them.
 func runMutation(ctx context.Context, edge *intern.DirectedEdge, txn *posting.Txn) error {
+	if ctx.Err() != nil {
+		return ctx.Err()
+	}
 	if tr, ok := trace.FromContext(ctx); ok {
 		tr.LazyPrintf("%s", "In run mutations")
 	}
-- 
GitLab