[erlang-bugs] file:sendfile broken on FreeBSD?

jens@REDACTED jens@REDACTED
Sat Sep 12 20:04:30 CEST 2015


Hi

I've created a pull request with a patch for this bug. It can be found 
here: https://github.com/erlang/otp/pull/831

JP

On 2015-09-09 09:13, Jens Páll wrote:
> Ah, sorry about that.
> 
> I'm using version 18 (erts-7.0).
> 
> Luic suggested I'd try disabling the async threads (+A 0) but I got
> the same results.
> 
> JP
> 
> On 09.09.2015 07:33, Lukas Larsson wrote:
> 
>> Hello Jens,
>> 
>> Thanks for the bug report.
>> 
>> I cannot find any information about which versions of Erlang/OTP you
>> have tried this on.
>> 
>> Lukas
>> 
>> On Tue, Sep 8, 2015 at 11:09 PM, Jens Páll <jens@REDACTED>
>> wrote:
>> 
>>> Hi
>>> 
>>> I've been doing some tests using file:sendfile on FreeBSD 10 and
>>> it seems to be broken. It's unable to send files that are larger
>>> than the OS send buffer.
>>> 
>>> For example, if the buffer is 32KB, then only 48.996 bytes are
>>> sent to the client but from time to time it sends 130.708 bytes.
>>> It's always those numbers of bytes sent, 48.996 being the more
>>> popular one.
>>> 
>>> I discovered this when using Cowboy. I contacted Luic and we have
>>> been discussing some options, like the server could be closing the
>>> socket too soon. I created a simple test server to try things out
>>> where I for example delayed the closing of the socket well beyond
>>> the time it took the client to receive a full buffer. It had no
>>> effect, that is, the client just received its one and a half
>>> buffer and then waited until the server got to closing the socket.
>>> I tried both versions of sendfile.
>>> 
>>> If I use gen_tcp:send instead, the data is sent without any
>>> problems so I know the server works correctly.
>>> 
>>> Luic is planning on testing this in a few days but since I'm
>>> pretty sure (I can't rule out the possibility that I could be
>>> doing something wrong) the problem lies with Erlang itself I
>>> decided to post this here to get some further feedback.
>>> 
>>> I have a test server and client on github if someone cares to take
>>> a look: https://github.com/theom/eclm [1]
>>> 
>>> Thanks,
>>> 
>>> Jens Páll
>>> 
>>> _______________________________________________
>>> erlang-bugs mailing list
>>> erlang-bugs@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-bugs [2]
> 
> 
> 
> Links:
> ------
> [1] https://github.com/theom/eclm
> [2] http://erlang.org/mailman/listinfo/erlang-bugs
> 
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs




More information about the erlang-bugs mailing list