Skip to content

Commit

Permalink
[fix ]: worker wait 0.5sec then stop the grpc server after receive th…
Browse files Browse the repository at this point in the history
…e End signal

Signed-off-by: Bo-Wei Chen(BWbwchen) <tim.chenbw@gmail.com>
  • Loading branch information
BWbwchen committed Nov 7, 2023
1 parent bde2b11 commit c7bab39
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions worker/mainInterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"net"
"os"
"plugin"
"time"

"github.com/BWbwchen/MapReduce/rpc"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -41,6 +42,7 @@ func StartWorker(pluginFile string, nReduce int, addr string, storeInRAM bool) {
defer workerStruct.Client.(*masterClient).conn.Close()

<-workerStruct.EndChan
time.Sleep(500 * time.Millisecond)
baseServer.Stop()
}

Expand Down

0 comments on commit c7bab39

Please sign in to comment.