xboard exit (no response from ICS)

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

xboard exit (no response from ICS)

Postby jdart » 06 Jan 2017, 18:03

FYI I am currently running xboard 4.9.1 as an ICS client and am seeing pretty often that xboard exits
in the middle of a game. I only see this:

Code: Select all
>ICS: date\015\012
18340724 <first : # time check interval=9875 elapsed_time=321421 target=9999999
18340724 <first : # 36. move=a2-a3 score=2840 terminate=0
18445647 <first : # time check interval=9904 elapsed_time=426344 target=9999999
18445647 <first : # 37. move=a2-a3 score=2840 terminate=0
GameEnds(29, xboard exit, 2)
18619306 >first : force
18619306 >first : ping 14
18619306 >first : quit


in the logs and if I look at the console it says "no response from ICS". But the ICS is up.
The engine is also alive (I was in fact running it attached to the debugger and I see no error).
Could be a network glitch of course. But this seems more frequent since I started using
4.9.1. I see this both with chessclub.com and freechess.org.

The command line specifies -keepAlive 5 so the connection should not drop due to inactivity
(it shouldn't anyway during game play, I think).

--Jon
User avatar
jdart
 
Posts: 105
Joined: 26 Sep 2004, 21:11
Location: San Jose, CA

Re: xboard exit (no response from ICS)

Postby H.G.Muller » 06 Jan 2017, 23:41

From the posted log I would say your connection died. Look at the time stamps. Unfortunately XBoard doesn't print one for things its sends to the ICS. But it sends 'date' and then between the first engine message after it, and the XBoard exit there is 280 sec, without any response to the 'date' command coming from the ICS.

The way it works is that keepAlive events are scheduled the requested interval after each other or after sending a move to the ICS (which reschedules the event). If a keepAlive event occurs without anything having been received from the ICS since the previous one, XBoard concludes the connection is dead, and exits with the "No response from ICS" message.

I think it is very unlikely that I introduced a bug that would make XBoard close the connection by accident. XBoard would immediately exit with the message 'Connection closed by ICS' as soon as it gets an error or EOF from the socket it is reading from anyway, even if it would have closed the socket by itself.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: xboard exit (no response from ICS)

Postby jdart » 07 Jan 2017, 01:25

If a keepAlive event occurs without anything having been received from the ICS since the previous one, XBoard concludes the connection is dead, and exits with the "No response from ICS" message.


If i set keepalive to 5 minutes but am playing a very long time control game, it could be the opponent is taking a very
long time to move, could be > 5 minutes and so nothing might come in since the last keepAlive.

So if I understand you right - in that case it will terminate the connection? That seems unintuitive since I thought the
purpose of keepalive was to avoid the engine seeming idle for a long time, not to set an upper limit on how long xboard
has to receive a response.

--Jon
User avatar
jdart
 
Posts: 105
Joined: 26 Sep 2004, 21:11
Location: San Jose, CA

Re: xboard exit (no response from ICS)

Postby H.G.Muller » 07 Jan 2017, 10:59

jdart wrote:So if I understand you right - in that case it will terminate the connection?

No, in that case it will send a 'date' command. Only if 5min later there has also been no reply to that date command it will terminate the connection.

The codeis this

Code: Select all
void
KeepAlive ()
{   // [HGM] alive: periodically send dummy (date) command to ICS to prevent time-out
    if(!connectionAlive) DisplayFatalError("No response from ICS", 0, 1);
    connectionAlive = FALSE; // only sticks if no response to 'date' command.
    SendToICS("date\n");
    if(appData.keepAlive) ScheduleDelayedEvent(KeepAlive, appData.keepAlive*60*1000);
}

Here 'connectionAlive' is set whenever a message is received from the ICS. The KeepAlive even is rescheduled every time you play a move, to prevent spurious date output while playing.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 6 guests