sks-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sks-devel] SKS RAM usage gone haywire


From: Kim Minh Kaplan
Subject: Re: [Sks-devel] SKS RAM usage gone haywire
Date: Sun, 22 Mar 2009 14:14:02 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

I was seeing this in recon.log:

    2009-03-22 08:34:10 Error getting missing keys: Out of memory

This is because the server makes use of the response even though the
request failed.  It then proceed onto erronously alloc huge amount of
memory (which sometimes fail).  On most systems this is not very serious
as the memory is never used so never really alloced.  This fixes it,
i.e. it does not try to use the result of failed requests.

Kim Minh.

diff -r 2cb760c4b34b -r 809482afe9f4 reconComm.ml
--- a/reconComm.ml      Sun Mar 22 09:33:32 2009 +0000
+++ b/reconComm.ml      Sun Mar 22 14:06:49 2009 +0000
@@ -84,7 +84,11 @@
                                     (String.length msg));
                cout#write_string msg;
                cout#flush;
-               ignore (input_line cin#inchan); (* read "HTTP" line *)
+               (* read "HTTP" line and make sure the status is 2xx *)
+               let status_re = Str.regexp "^HTTP/[0-9]+\\.[0-9]+ 2" in
+               let status = input_line cin#inchan in
+               if not (Str.string_match status_re status 0) then
+                 failwith status;
                let _headers = Wserver.parse_headers Map.empty cin#inchan in
                let keystrings = 
                  CMarshal.unmarshal_list ~f:CMarshal.unmarshal_string cin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]