Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
parallel_service: recover
Browse files Browse the repository at this point in the history
  • Loading branch information
funny-falcon committed Oct 21, 2013
1 parent ec4be5d commit 5138305
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions parallel_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package iproto

import (
"log"
"runtime"
"sync"
"time"
)
Expand Down Expand Up @@ -101,6 +102,12 @@ Loop:
}

func (serv *ParallelService) inc(ctx *ReqContext) {
if err := recover(); err != nil {
log.Print(err)
btrace := &[2048]byte{}
n := runtime.Stack(btrace[:], false)
log.Printf("%s", btrace[:n])
}
ctx.Done()
ctx.gen.Release()
serv.sema <- struct{}{}
Expand Down

0 comments on commit 5138305

Please sign in to comment.