Commit 33b2c2f1 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse: don't get Pool elements under lock

Pool.Get() can trigger a GC, and we see this GC being hung in stack
traces for the TestDeleteNotify test case.

See issue #261.

Change-Id: I278a05fc3c6a59c701686aebd410511c5502d9d5
parent 48d90837
...@@ -255,13 +255,14 @@ func handleEINTR(fn func() error) (err error) { ...@@ -255,13 +255,14 @@ func handleEINTR(fn func() error) (err error) {
// Returns a new request, or error. In case exitIdle is given, returns // Returns a new request, or error. In case exitIdle is given, returns
// nil, OK if we have too many readers already. // nil, OK if we have too many readers already.
func (ms *Server) readRequest(exitIdle bool) (req *request, code Status) { func (ms *Server) readRequest(exitIdle bool) (req *request, code Status) {
req = ms.reqPool.Get().(*request)
dest := ms.readPool.Get().([]byte)
ms.reqMu.Lock() ms.reqMu.Lock()
if ms.reqReaders > _MAX_READERS { if ms.reqReaders > _MAX_READERS {
ms.reqMu.Unlock() ms.reqMu.Unlock()
return nil, OK return nil, OK
} }
req = ms.reqPool.Get().(*request)
dest := ms.readPool.Get().([]byte)
ms.reqReaders++ ms.reqReaders++
ms.reqMu.Unlock() ms.reqMu.Unlock()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment