Project

General

Profile

Bug #1576

Sometimes no HTTP error when file can't be opened

Added by admin over 11 years ago. Updated almost 11 years ago.

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

0%

Estimated time:
Missing in 1.5.x:

Description

Hi,

When Lighttpd is running out of FDs, sometimes it returns 500, sometimes it just closes the connection.
I've no idea why the behaviour isn't consistent.


accept(4, {sa_family=AF_INET, sin_port=htons(2591), sin_addr=inet_addr("192.168.1.34")}, [16]) = 1023
fcntl64(1023, F_SETFD, FD_CLOEXEC)      = 0
fcntl64(1023, F_SETFL, O_RDWR|O_NONBLOCK) = 0
ioctl(1023, FIONREAD, [44])             = 0
read(1023, "GET /xcc.tar.gz HTTP/1.0\r\nHost: xwis.net\r\n\r\n", 63) = 44
setsockopt(1023, SOL_TCP, TCP_CORK, [1], 4) = 0
writev(1023, [{"HTTP/1.0 200 OK\r\nConnection: close\r\nContent-Type: application/octet-stream\r\nAcce"..., 188}], 1) = 188
open("/var/www/xcc.tar.gz", O_RDONLY|O_LARGEFILE) = -1 EMFILE (Too many open files)
write(5, "2008-02-28 10:43:28: (network_linux_sendfile.c.143) open failed:  Too many open "..., 87) = 87
setsockopt(1023, SOL_TCP, TCP_CORK, [0], 4) = 0
write(5, "2008-02-28 10:43:28: (connections.c.603) connection closed: write failed on fd 1"..., 85) = 85
close(1023)                             = 0

accept(4, {sa_family=AF_INET, sin_port=htons(2628), sin_addr=inet_addr("192.168.1.34")}, [16]) = 1023
fcntl64(1023, F_SETFD, FD_CLOEXEC)      = 0
fcntl64(1023, F_SETFL, O_RDWR|O_NONBLOCK) = 0
ioctl(1023, FIONREAD, [44])             = 0
read(1023, "GET /xcc.tar.gz HTTP/1.0\r\nHost: xwis.net\r\n\r\n", 63) = 44
stat64("/var/www/xcc.tar.gz", {st_mode=S_IFREG|0644, st_size=11426599, ...}) = 0
open("/var/www/xcc.tar.gz", O_RDONLY|O_LARGEFILE) = -1 EMFILE (Too many open files)
write(5, "2008-02-28 10:43:30: (response.c.537) file not found ... or so:  Too many open f"..., 102) = 102
setsockopt(1023, SOL_TCP, TCP_CORK, [1], 4) = 0
writev(1023, [{"HTTP/1.0 500 Internal Server Error\r\nConnection: close\r\nContent-Type: text/html\r\n"..., 165}, {"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD X"..., 369}], 2) = 534
setsockopt(1023, SOL_TCP, TCP_CORK, [0], 4) = 0
close(1023)       

History

#1

Updated by admin over 11 years ago

Ah, it's probably related to stat caching. I think it should open the file before sending the headers, instead of the other way around.

#2

Updated by stbuehler about 11 years ago

  • Status changed from New to Fixed
  • Resolution set to wontfix

I think everyone should just set their fd limit high enough; i don't see how we can fix this in a simple way for 1.4; 1.5 should handle EMFILE better.

#3

Updated by stbuehler almost 11 years ago

  • Status changed from Fixed to Wontfix

Also available in: Atom