guile-rpc-bugs
[Top][All Lists]
Advanced

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

[Guile-rpc-bugs] RPC server loop, `select' -- system call is interrupted


From: Artyom Poptsov
Subject: [Guile-rpc-bugs] RPC server loop, `select' -- system call is interrupted
Date: Sat, 03 May 2014 20:56:26 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi,

I try to make use of Guile-RPC in my project [0], and everything works
almost as expected, except that I sometimes get the following error:

--8<---------------cut here---------------start------------->8---
Backtrace:
In ice-9/boot-9.scm:
 157: 9 [catch #t #<catch-closure 935c2a0> ...]
In unknown file:
   ?: 8 [apply-smob/1 #<catch-closure 935c2a0>]
In ice-9/boot-9.scm:
  63: 7 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 6 [eval # #]
In unknown file:
   ?: 5 [call-with-input-string "(apply (module-ref (resolve-module '(awget 
awget)) 'main) (command-line))" ...]
In ice-9/command-line.scm:
 180: 4 [#<procedure 935e1a0 at ice-9/command-line.scm:175:6 (port)> #<input: 
string 97cbf00>]
In unknown file:
   ?: 3 [eval (apply # #) #<directory # 9309630>]
In /usr/local/bin/awget:
 308: 2 [main "guile" "-d"]
In rpc/rpc/server.scm:
 469: 1 [run-input-event-loop ((#<input-output: socket 11> . #)) 1000000 ...]
In unknown file:
   ?: 0 [select (#<input-output: socket 11>) () (#<input-output: socket 11>) 1 
0]

ERROR: In procedure select:
ERROR: In procedure select: Interrupted system call
--8<---------------cut here---------------end--------------->8---

The program runs on Gentoo GNU/Linux (Base System release 2.2), with GNU
Guile 2.0.9 and GNU Guile-RPC (commit 17043e8).

It happens just after start (in ~30s), before any RPCs, during `select'
call in modules/rpc/rpc/server.scm, here:

--8<---------------cut here---------------start------------->8---
               (selected (select fd-list '() fd-list
                                 timeout-s timeout-us))
--8<---------------cut here---------------end--------------->8---

I did some investigation and tests [1] and found that I can cause this
error by sending a signal to the RPC server process -- `select' call is
interrupted when RPC server process receives a signal and handles it in
the registered handler.  And then the server fails.

Currently I use a workaround in my program to restart RPC server when
the error occurs.  The reason why I ran into problems with signals is
still under investigation.

But the question is: Whether the observed failure is the correct
behavior of RPC server or not?  In other words, should `system-error'
with EINTR errno be caught inside `run-stream-rpc-server' loop?

If the exception should be handled in Guile-RPC -- I can provide a patch
that does that (something like what has been mentioned in [2]).

Thanks,

- Artyom

[0] https://github.com/artyom-poptsov/awget
[1] 
https://github.com/artyom-poptsov/guile-rpc-sandbox/tree/select-interrupted-system-call-issue-reproduction
[2] https://lists.gnu.org/archive/html/guile-user/2013-07/msg00011.html

-- 
Artyom V. Poptsov <address@hidden>
Home page: http://poptsov-artyom.narod.ru/



reply via email to

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