On 26 April 2017 at 11:03, Jan Mercl <0xj...@gmail.com> wrote:
> On Wed, Apr 26, 2017 at 11:58 AM roger peppe <rogpe...@gmail.com> wrote:
>
>> FWIW I have seen real problems in production where long-running worker
> goroutines stopped working. We looked into it and found that certain rare
> requests were panicking, not releasing a mutex
> and thus preventing the long-running goroutine from acquiring that mutex.
>
> Code bug: Don't Lock without defer Unlock(). (I'm a sinner, just telling
> what I learned.)

Just for the record, there are *many* occurrences of Unlock without defer,
even in the standard library.

     $ cd $GOROOT
     $ find . -name '*.go' | grep -v test | xargs grep '\.Unlock(' |
grep -v defer | wc
         242     489   11123

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to