Ticket #1575 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

net.inet.tcp.blackhole and spawn-fcgi

Reported by: tofig@freebsd.az Assigned to: jan
Priority: low Milestone: 1.5.0
Component: spawn-fcgi Version: 1.4.18
Severity: minor Keywords: freebsd spawn-fcgi net.inet.tcp.blackhole
Cc: Blocking:
Need Feedback: 0

Description

When setting net.inet.tcp.blackhole > 0 on the FreeBSD, spawn-fcgi hangs trying to accomplish the connect syscall on 94'th line of the spawn-fcgi.c:

if (-1 == connect(fcgi_fd, fcgi_addr, servlen)) {

As I understand, this is a simple check for the port availability which can't be accomplished due to the blackhole option activated. As soon as I deactivate the blackhole option, spawn-fcgi spawns correctly.

I suggest to get rid of this check, because later we call a 'bind' syscall anyway, which also returns error in case if the port is already in use. Why do we do redundant checking ?

Additionally it will also fix the things with the FreeBSD blackhole feature.

Here is a diff for review: www.freebsd.az/other/spawn-fcgi.patch

Attachments

Change History

02/26/2008 11:46:10 PM changed by stbuehler

Did you try what happens if you start spawn-fcgi a second time?

I think it will delete the first socket (unlink in the source), and create a new one - and then you have 2 fcgi processes running, but the first one is unreachable as its socket is deleted (but not closed); check by killing the second one (with all childs) and try connecting to it (e.g. with the original spawn-fcgi). (Tested on my linux box)

Please give feedback how FreeBSD behaves ;-)

02/27/2008 03:52:21 PM changed by tofig@freebsd.az

  • pending deleted.

When I start the second instance of the unpatched spawn-fcgi it gives me: spawn-fcgi.c.224: socket is already used, can't spawn and exits.

With the patch applied it gives me: spawn-fcgi.c.118: bind failed: Address already in use and exits.

02/28/2008 09:56:32 AM changed by Olaf van der Spek

You're using IP sockets, while stbuehler is talking about Unix sockets.

02/28/2008 11:46:36 AM changed by stbuehler

Oh... hehe. Should have seen the "tcp" in "net.inet.tcp.blackhole", sry.

02/28/2008 12:19:53 PM changed by stbuehler

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [2106]


Add/Change #1575 (net.inet.tcp.blackhole and spawn-fcgi)




Change Properties
Action