Skip to content

Commit

Permalink
eio_linux: remove logging
Browse files Browse the repository at this point in the history
There were only two remaining uses, neither of which has proved useful.
The warning about an unknown response to cancellation has never been
seen, and the warning about being unable to allocate a fixed buffer just
annoys people.
  • Loading branch information
talex5 committed Mar 8, 2024
1 parent 5e66181 commit ebf7fa0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
(alcotest (and (>= 1.7.0) :with-test))
(eio (= :version))
(mdx (and (>= 2.2.0) :with-test))
(logs (>= 0.7.0))
(logs (and (>= 0.7.0) :with-test))
(fmt (>= 0.8.9))
(cmdliner (and (>= 1.1.0) :with-test))
(uring (>= 0.7))))
Expand Down
2 changes: 1 addition & 1 deletion eio_linux.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ depends: [
"alcotest" {>= "1.7.0" & with-test}
"eio" {= version}
"mdx" {>= "2.2.0" & with-test}
"logs" {>= "0.7.0"}
"logs" {>= "0.7.0" & with-test}
"fmt" {>= "0.8.9"}
"cmdliner" {>= "1.1.0" & with-test}
"uring" {>= "0.7"}
Expand Down
2 changes: 1 addition & 1 deletion lib_eio_linux/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(flags :standard -D_LARGEFILE64_SOURCE)
(include_dirs ../lib_eio/unix/include)
(names eio_stubs))
(libraries eio eio.utils eio.unix uring logs fmt))
(libraries eio eio.utils eio.unix uring fmt))

(rule
(enabled_if
Expand Down
2 changes: 0 additions & 2 deletions lib_eio_linux/log.ml

This file was deleted.

14 changes: 5 additions & 9 deletions lib_eio_linux/sched.ml
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,11 @@ and handle_complete st ~runnable result =
| Job_no_cancel k ->
Suspended.continue k result
| Cancel_job ->
begin match result with
| 0 (* Operation cancelled successfully *)
| -2 (* ENOENT - operation completed before cancel took effect *)
| -114 (* EALREADY - operation already in progress *)
-> ()
| errno ->
Log.warn (fun f -> f "Cancel returned unexpected error: %s" (Unix.error_message (Uring.error_of_errno errno)))
end;
(* We don't care about the result of the cancel operation, and there's nowhere to send it.
The possibilities are:
0 : Operation cancelled successfully
-2 : ENOENT - operation completed before cancel took effect
-114 : EALREADY - operation already in progress *)
schedule st
| Job_fn (k, f) ->
Fiber_context.clear_cancel_fn k.fiber;
Expand Down Expand Up @@ -552,7 +549,6 @@ let with_sched ?(fallback=no_fallback) config fn =
| Ok () ->
Some (Uring.Region.init ~block_size buf n_blocks)
| Error `ENOMEM ->
Log.warn (fun f -> f "Failed to allocate %d byte fixed buffer" fixed_buf_len);
None
in
let run_q = Lf_queue.create () in
Expand Down
4 changes: 2 additions & 2 deletions lib_eio_linux/tests/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
(= %{system} "linux_elf") ; Historically, Linux-x86_32
(= %{system} "elf"))) ; Historically, Linux-ppc64
(modules eurcp_lib)
(libraries eio_linux))
(libraries eio_linux logs))

(executable
(name eurcp)
Expand Down Expand Up @@ -47,7 +47,7 @@
(= %{system} "linux_elf") ; Historically, Linux-x86_32
(= %{system} "elf"))) ; Historically, Linux-ppc64
(modules test)
(libraries alcotest eio_linux))
(libraries alcotest eio_linux logs))

(mdx
(package eio_linux)
Expand Down

0 comments on commit ebf7fa0

Please sign in to comment.