Loading ...
Sorry, an error occurred while loading the content.

lwt or ocsigen problem I have no idea

Expand Messages
  • Komtanoo Pinpimai
    Hi, I should ask this in the Lwt or Ocsigen mailing list but I m not quite sure where they are or even they exist. I m running an ocsigen server like a
    Message 1 of 3 , May 20, 2013
    • 0 Attachment
      Hi, I should ask this in the Lwt or Ocsigen mailing list but I'm not quite
      sure where they are or even they exist.

      I'm running an ocsigen server like a webservice that makes some http calls
      and returns result. Every now and then it would id with

      Fatal error: exception Unix.Unix_error(12, "select", "")

      (in OSX)

      In linux it throws the following message and stop accepting new connection:

      Max number of file descriptors reached unexpectedly, please check...

      ---

      I suspected that it's coming from the same cause so I wrote a small script
      as:

      ---

      open Lwt

      let rec run_x i =
      Ocsigen_http_client.get_url "http://apache.org/xx" >>= (fun _ ->
      Printf.printf "ok %d\n" i; flush_all(); run_x (i+1))

      let _ =
      Lwt_main.run ( run_x 0)

      ---

      In osx, it's able to fetch that URL up to 1014 times, and died with that
      exception.
      It smells like that url fetch function does not close its file descriptors
      after fetching.

      Any idea ?

      thanks
      -kem


      [Non-text portions of this message have been removed]
    • Komtanoo Pinpimai
      nevermind, just saw on the manual that Ocsigen_stream.finalize has to be called manually or
      Message 2 of 3 , May 21, 2013
      • 0 Attachment
        nevermind, just saw on the manual that
        Ocsigen_stream.finalize<http://ocsigen.org/ocsigenserver/api/Ocsigen_stream#VALfinalize>
        has
        to be called manually or the fd will leak.


        On Tue, May 21, 2013 at 12:26 AM, Komtanoo Pinpimai <romerun@...>wrote:

        > **
        >
        >
        > Hi, I should ask this in the Lwt or Ocsigen mailing list but I'm not quite
        > sure where they are or even they exist.
        >
        > I'm running an ocsigen server like a webservice that makes some http calls
        > and returns result. Every now and then it would id with
        >
        > Fatal error: exception Unix.Unix_error(12, "select", "")
        >
        > (in OSX)
        >
        > In linux it throws the following message and stop accepting new connection:
        >
        > Max number of file descriptors reached unexpectedly, please check...
        >
        > ---
        >
        > I suspected that it's coming from the same cause so I wrote a small script
        > as:
        >
        > ---
        >
        > open Lwt
        >
        > let rec run_x i =
        > Ocsigen_http_client.get_url "http://apache.org/xx" >>= (fun _ ->
        > Printf.printf "ok %d\n" i; flush_all(); run_x (i+1))
        >
        > let _ =
        > Lwt_main.run ( run_x 0)
        >
        > ---
        >
        > In osx, it's able to fetch that URL up to 1014 times, and died with that
        > exception.
        > It smells like that url fetch function does not close its file descriptors
        > after fetching.
        >
        > Any idea ?
        >
        > thanks
        > -kem
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >



        --
        In accordance with U.S. Treasury regulations, if this message contains
        advice concerning one or more Federal tax issues, it is not a formal legal
        opinion and may not be used by any person for the avoidance of Federal tax
        penalties.


        [Non-text portions of this message have been removed]
      • Ashish Agarwal
        ... even they exist See the Support and community page on ocsigen.org for information about their mailing list and other forums. ... [Non-text portions of
        Message 3 of 3 , May 21, 2013
        • 0 Attachment
          > Lwt or Ocsigen mailing list but I'm not quite sure where they are or
          even they exist

          See the "Support and community" page on ocsigen.org for information about
          their mailing list and other forums.


          On Tue, May 21, 2013 at 7:23 AM, Komtanoo Pinpimai <romerun@...>wrote:

          > nevermind, just saw on the manual that
          > Ocsigen_stream.finalize<
          > http://ocsigen.org/ocsigenserver/api/Ocsigen_stream#VALfinalize>
          > has
          > to be called manually or the fd will leak.
          >
          >
          > On Tue, May 21, 2013 at 12:26 AM, Komtanoo Pinpimai <romerun@...
          > >wrote:
          >
          > > **
          > >
          > >
          > > Hi, I should ask this in the Lwt or Ocsigen mailing list but I'm not
          > quite
          > > sure where they are or even they exist.
          > >
          > > I'm running an ocsigen server like a webservice that makes some http
          > calls
          > > and returns result. Every now and then it would id with
          > >
          > > Fatal error: exception Unix.Unix_error(12, "select", "")
          > >
          > > (in OSX)
          > >
          > > In linux it throws the following message and stop accepting new
          > connection:
          > >
          > > Max number of file descriptors reached unexpectedly, please check...
          > >
          > > ---
          > >
          > > I suspected that it's coming from the same cause so I wrote a small
          > script
          > > as:
          > >
          > > ---
          > >
          > > open Lwt
          > >
          > > let rec run_x i =
          > > Ocsigen_http_client.get_url "http://apache.org/xx" >>= (fun _ ->
          > > Printf.printf "ok %d\n" i; flush_all(); run_x (i+1))
          > >
          > > let _ =
          > > Lwt_main.run ( run_x 0)
          > >
          > > ---
          > >
          > > In osx, it's able to fetch that URL up to 1014 times, and died with that
          > > exception.
          > > It smells like that url fetch function does not close its file
          > descriptors
          > > after fetching.
          > >
          > > Any idea ?
          > >
          > > thanks
          > > -kem
          > >
          > > [Non-text portions of this message have been removed]
          > >
          > >
          > >
          >
          >
          >
          > --
          > In accordance with U.S. Treasury regulations, if this message contains
          > advice concerning one or more Federal tax issues, it is not a formal legal
          > opinion and may not be used by any person for the avoidance of Federal tax
          > penalties.
          >
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >
          > ------------------------------------
          >
          > Archives up to December 31, 2011 are also downloadable at
          > http://www.connettivo.net/cntprojects/ocaml_beginners
          > The archives of the very official ocaml list (the seniors' one) can be
          > found at http://caml.inria.fr
          > Attachments are banned and you're asked to be polite, avoid flames
          > etc.Yahoo! Groups Links
          >
          >
          >
          >


          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.