Project

General

Profile

Actions

Bug #987

closed

error:network_freebsd_sendfile.c.175

Added by Anonymous over 17 years ago. Updated almost 8 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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 1 (0 open1 closed)

Is duplicate of Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelFixedActions
Actions #1

Updated by darix over 17 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.

Actions #2

Updated by Anonymous almost 16 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.

Actions #3

Updated by gstrauss about 8 years 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.

Actions #4

Updated by stbuehler about 8 years 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.

Actions #5

Updated by gstrauss about 8 years ago

  • Is duplicate of Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernel added
Actions #6

Updated by gstrauss about 8 years 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.

Actions #7

Updated by gstrauss almost 8 years ago

  • Status changed from Patch Pending to Fixed
Actions

Also available in: Atom