SSLTunnel won't startup if a previous instance was killed with sockets still opened

RESOLVED FIXED in mozilla1.9.3a1

Status

RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: mossop, Assigned: mossop)

Tracking

Trunk
mozilla1.9.3a1
x86
Mac OS X
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed1.9.2.1, fixed1.9.1.8])

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
If SSLTunnel is killed when it still has some connections opened then the connections are closed but (at least on linux) remain in the TIME_WAIT state for a short time. This stops a subsequent instance of SSLTunnel from starting as it fails to bind to the still open socket. We can avoid this by setting the SO_REUSEADDR option before attempting to bind. This will allow rebinding an existing socket in the TIME_WAIT state. The alternative would be delaying for short times if unable to bind but this seems the most elegant solution.
(Assignee)

Updated

9 years ago
Blocks: 478241
(Assignee)

Updated

9 years ago
Blocks: 435743
(Assignee)

Comment 1

9 years ago
Created attachment 420224 [details] [diff] [review]
patch rev 1

Simple fix, just sets the Reuseaddr option on the socket before binding.
Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Attachment #420224 - Flags: review?(ted.mielczarek)
Attachment #420224 - Flags: review?(ted.mielczarek) → review+
Version: unspecified → Trunk
(Assignee)

Updated

9 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
You need to log in before you can comment on or make changes to this bug.