Longer timeout

This commit is contained in:
Anthony Scemama 2022-01-12 23:19:44 +01:00
parent bb64e47ac9
commit adce2efde7
2 changed files with 11 additions and 7 deletions

View File

@ -721,10 +721,14 @@ let run ?(daemon=true) ezfio_filename =
Unix.gettimeofday () Unix.gettimeofday ()
in in
let msg = let msg =
(*
List.rev_map String.trim raw_msg List.rev_map String.trim raw_msg
|> List.rev |> List.rev
|> Message.create |> Message.create
and msg_size = *)
Message.create raw_msg
in
let msg_size =
List.fold_left (fun accu x -> accu + (String.length x)) 0 raw_msg List.fold_left (fun accu x -> accu + (String.length x)) 0 raw_msg
in in
let recv_log = let recv_log =
@ -787,12 +791,12 @@ let run ?(daemon=true) ezfio_filename =
let polling = let polling =
Zmq.Poll.poll ~timeout:1000 pollitem Zmq.Poll.poll ~timeout:1000 pollitem
in in
match polling.(1) with match polling.(0) with
| Some Zmq.Poll.In -> handle_pull !status | Some Zmq.Poll.In -> handle_rep ()
| _ -> | _ ->
begin begin
match polling.(0) with match polling.(1) with
| Some Zmq.Poll.In -> handle_rep () | Some Zmq.Poll.In -> handle_pull !status
| _ -> | _ ->
begin begin
flush !block_channel ; flush !block_channel ;

View File

@ -90,14 +90,14 @@ subroutine zmq_unregister_worker(msg)
! Timeout 15 seconds ! Timeout 15 seconds
rc = -1 rc = -1
do i=1,15 do i=1,20
rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, 32, ZMQ_NOBLOCK) rc = f77_zmq_recv(zmq_to_dataserver_socket, buffer, 32, ZMQ_NOBLOCK)
if (rc == 2) then if (rc == 2) then
call worker_log(irp_here, 'Unregistered') call worker_log(irp_here, 'Unregistered')
return return
endif endif
call worker_log(irp_here, 'Unregister failed. Retrying') call worker_log(irp_here, 'Unregister failed. Retrying')
call sleep(1) call sleep(5)
enddo enddo
call abrt(irp_here, 'Unregister failed') call abrt(irp_here, 'Unregister failed')