logo       

Patch: backend clobber prevention: msg#00015

web.server.perlbal.general

Subject: Patch: backend clobber prevention

I swear I sent this patch out a while ago, but it isn't in the latest SVN perlbal code and it just bit us in the butt again, now that we're updating to it.

There is a condition where a ClientProxy can be given a new Backend C, but its old Backend B retains a reference to the ClientProxy. When the Backend B is closed, it tries to null out the ClientProxy's reference to the Backend B, but actually ends up clobbering the ClientProxy's reference to Backend C. This results in a horrible memory leak when you're serving up big files like we are.

Anyway.. the attached patch fixes it.

Eric...
Index: BackendHTTP.pm
===================================================================
--- BackendHTTP.pm (revision 559)
+++ BackendHTTP.pm (working copy)
@@ -138,7 +138,10 @@

# tell our client that we're gone
if (my $client = $self->{client}) {
- $client->backend(undef);
+ # don't clobber any other backend
+ if ($client->backend() && $self == $client->backend()) {
+ $client->backend(undef);
+ }
$self->{client} = undef;
}
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise