Ticket #1576 (closed defect: wontfix)

Opened 6 months ago

Last modified 10 days ago

Sometimes no HTTP error when file can't be opened

Reported by: Olaf van der Spek Owned by: jan
Priority: normal Milestone: 1.5.0
Component: core Version: 1.4.18
Severity: normal Keywords:
Cc: Blocked By:
Need User Feedback: no Blocking:

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)       

Attachments

Change History

Changed 6 months ago by Olaf van der Spek

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.

Changed 10 days ago by stbuehler

  • status changed from new to closed
  • 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.

Add/Change #1576 (Sometimes no HTTP error when file can't be opened)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.