pool
pool copied to clipboard
fix deadlock when batch canceled, some workUnit's done channel can't be closed
It happend in this situation:
- call Batch.Cancel()
- wu.cancelling is set in cancelWithError()
- wu.writing is set in Queue() now, wu.done is never closed, batch will wait forever