Project

General

Profile

Bug #987

error:network_freebsd_sendfile.c.175

Added by Anonymous about 10 years ago. Updated 11 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
core
Target version:
Start date:
Due date:
% Done:

0%

Missing in 1.5.x:

Description

I seem to have a problem serving files with
lighttpd from non local (smbfs) filesystem.
Lighttpd tries to use sendfile but, i have the following error:
(network_freebsd_sendfile.c.175) sendfile: Operation not supported 45
(connections.c.588) connection closed: write failed on fd 7.
The version is lighttpd-1.4.13


Related issues

Duplicates Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernel Fixed

Associated revisions

Revision c46f0ce0 (diff)
Added by gstrauss 11 months ago

[core] fallback to write if sendfile not supported (fixes #471, #987)

x-ref:
"sendfile backends do not fall back to write/writev if they are not supported by the kernel"
https://redmine.lighttpd.net/issues/471
"error:network_freebsd_sendfile.c.175"
https://redmine.lighttpd.net/issues/987

github: closes #58

History

#1 Updated by darix about 10 years ago

so dont use sendfile if the underlying FS does not support it.
it is runtime configurable setting.

http://trac.lighttpd.net/trac/wiki/server.network-backendDetails

you have to use writev than.

#2 Updated by Anonymous almost 9 years ago

It's the server's job to switch as necessary. It's terrible to require this to be configured manually, when there's a clear, explicit error return from the syscall that can be used to detect it.

#3 Updated by gstrauss about 1 year ago

This is a very old ticket, but is marked High Priority.

On some systems, some filesystems support sendfile() and some do not. If lighttpd is configured to use sendfile() as the backend -- which is a global setting in lighttpd and not configurable per filesystem -- it would be nice if lighttpd could fall back to write() if sendfile() failed with EOPNOTSUPP. (feature request)

Please downgrade priority and mark this ticket as Feature Request.

This ticket should not be High Priority (and a 7-year-old ticket obviously wasn't :)) since there is a simple workaround: if you need to serve some files from a filesystem that does not support sendfile(), then do not use the freedbsd sendfile network backend in lighttpd.conf.

#4 Updated by stbuehler about 1 year ago

  • Description updated (diff)
  • Status changed from New to Wontfix
  • Assignee deleted (jan)
  • Priority changed from High to Normal

Fallback on syscalls sounds unnecessary expensive, I don't think we should support this.

#5 Updated by gstrauss 12 months ago

  • Duplicates Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernel added

#6 Updated by gstrauss 11 months ago

  • Status changed from Wontfix to Patch Pending
  • Target version set to 1.4.40

Submitted pull request https://github.com/lighttpd/lighttpd1.4/pull/58

An extra syscall each write is better than failure.

If someone changes the default backend, and then does not test to see if performance improves or degrades, then they will still have a working server. Anyone interested in performance should actually be measuring performance before and after tuning the settings.

This patch allows sendfile to be the chosen backend even if a smaller portion of requests fail with sendfile and fall back to write, e.g. the case in https://redmine.lighttpd.net/issues/471 with large file uploads stored in tempfiles being sent to backend via unix domain sockets on (older?) versions of Solaris.

#7 Updated by gstrauss 11 months ago

  • Status changed from Patch Pending to Fixed

Also available in: Atom