Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCaml exception found in ocsigenserver logs #185

Open
MdeLv opened this issue Apr 16, 2020 · 2 comments
Open

OCaml exception found in ocsigenserver logs #185

MdeLv opened this issue Apr 16, 2020 · 2 comments

Comments

@MdeLv
Copy link

MdeLv commented Apr 16, 2020

Debian 10
OCaml 4.07.1
ocsigenserver.2.16.0 (with ocsigen-start.2.16.1)
Makefile.os : RUN_DEBUG ?= "-v" (minimum verbosity)

==========================================
Here is a stdlib.ml raised exception found in the ocsigenserver logs.
It occurred after a non significant browser inactivity (a few seconds).
It has no visible impact from the website user. So it should be handled correctly.

It it normal to find it in ocsigenserver logs?
Can it be fixed in order to clean up logs?

DETAILS
(I don't know how to make that stuff foldable)

ocsigenserver: main: Unexpected exception in Server.wait_connection (handle connection): (Invalid_argument Lwt.wakeup)
ocsigenserver: main: backtrace:
ocsigenserver: main: Raised at file "stdlib.ml", line 34, characters 25-45
ocsigenserver: main: Called from file "ocsigen_http_com.ml", line 158, characters 2-33
ocsigenserver: main: Called from file "ocsigen_server.ml", line 836, characters 4-35
ocsigenserver: main: Called from file "src/core/lwt.ml", line 2048, characters 23-28

According the code of stdlib.ml, it's an "index out of bounds" array error:

$ cat stdlib.ml
let invalid_arg s = raise(Invalid_argument s) (* line 34 *)
$ cat ocsigen_http_com.ml
let abort conn =
  Lwt.wakeup (snd conn.closed) (); (* line 158 *)
  Lwt_ssl.abort conn.fd Aborted
$ cat ocsigen_server.ml
  let handle_write_errors e =
    begin match e with
      | Lost_connection e' ->
        warn sockaddr ("connection abruptly closed by peer ("
                       ^ Printexc.to_string e' ^ ")")
      | Ocsigen_http_com.Timeout ->
        warn sockaddr "timeout"
      | Ocsigen_http_com.Aborted ->
        dbg sockaddr "writing thread aborted"
      | Ocsigen_stream.Interrupted e' ->
        warn sockaddr ("interrupted content stream ("
                       ^ Printexc.to_string e' ^ ")")
      | _ ->
        Ocsigen_messages.unexpected_exception e "Server.handle_write_errors"
    end;
    Ocsigen_http_com.abort receiver; (* line 836 *)
    Lwt.fail Ocsigen_http_com.Aborted
$ cat lwt/core/scr/lwt.ml
let callback p_result =
        match p_result with
        | Fulfilled _ as p_result ->
          let State_may_now_be_pending_proxy p'' = may_now_be_proxy p'' in
          let p'' = underlying p'' in

          let State_may_have_changed p'' =
            resolve ~allow_deferring:false p'' p_result in
          ignore p''

        | Rejected exn ->
          current_storage := saved_storage;

          let p' = try h exn with exn -> fail exn in  (* line 2048 *)
          let Internal p' = to_internal_promise p' in

          let State_may_now_be_pending_proxy p'' = may_now_be_proxy p'' in
          let p'' = underlying p'' in

          let State_may_have_changed p'' =
            make_into_proxy ~outer_promise:p'' ~user_provided_promise:p' in
          ignore p''
@MdeLv
Copy link
Author

MdeLv commented Apr 28, 2020

Can you have a look at that issue?
Is it a normal message?
Thanks.

@glondu
Copy link
Contributor

glondu commented Jul 13, 2021

HTTP handling changed significantly in 3.0.0. Can you retry with a recent ocsigenserver?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants