[erlang-questions] file:write/2 blocking indefinitely

ANTHONY MOLINARO anthonym@REDACTED
Fri Oct 25 23:51:11 CEST 2013


Hi,

I've been having this odd issue lately with a system.  I have a file opened with

  file:open (File, [ write, raw, compressed ])

Held in a gen_server state, and send message which are then written to the file with

  file:write (FileHandle, Bytes)

However, every so often, the file:write/2 call just stops working and essentially blocks.
This causes the mailbox of the gen_server to slowly fill up and eventually the node runs out of memory.  We currently work around this issue, but I'm wondering if anyone has seen this sort of thing before, or has any ideas around work arounds?

I'm not sure if this is non-blocking call or not, if not is there an alternate file call which is non-blocking?  Does compression cause additional issues?  Is the fact that it's writing to an SSD have any bearing?

The system is

CentOS 5.4
Erlang R15B02

Thanks,

-Anthony

PS. The actual code is here in case anyone feels like a deeper look
https://github.com/lwes/lwes-erlang/blob/master/src/lwes_journaller.erl


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20131025/d45844b1/attachment.htm>


More information about the erlang-questions mailing list