[Xapian-tickets] [Xapian] #781: Sockets never closed on RemoteDatabase errors

Xapian nobody at xapian.org
Wed May 1 07:44:05 BST 2019


#781: Sockets never closed on RemoteDatabase errors
----------------------------+-------------------------
 Reporter:  Kronuz          |             Owner:  olly
     Type:  defect          |            Status:  new
 Priority:  high            |         Milestone:
Component:  Backend-Remote  |           Version:
 Severity:  blocker         |        Resolution:
 Keywords:                  |        Blocked By:
 Blocking:                  |  Operating System:  All
----------------------------+-------------------------

Comment (by olly):

 Thanks.  I needed to link with `-pthread` and this code tweak:

 {{{
 --- tst-xapian_remote.cc.orig   2019-05-01 18:37:20.246441957 +1200
 +++ tst-xapian_remote.cc        2019-05-01 18:38:25.242556029 +1200
 @@ -5,6 +5,7 @@
  #include <iostream>
  #include <string>
  #include <cstdio>
 +#include <cstring>
  #include <cassert>
  #include <thread>

 @@ -58,7 +59,7 @@
         }

         struct sockaddr_in serv_addr;
 -       memset(&serv_addr, 0, sizeof(serv_addr));
 +       std::memset(&serv_addr, 0, sizeof(serv_addr));
         serv_addr.sin_family = AF_INET;
         serv_addr.sin_addr.s_addr = INADDR_ANY;
         serv_addr.sin_port = htons(port);
 }}}

 But on Linux it starts to fail with:

 {{{
 NetworkError: Couldn't resolve host localhost (context:
 remote:tcp(localhost:5000)) (No address associated with hostname)
 }}}

 I guess that's a symptom of running out of fds.

--
Ticket URL: <https://trac.xapian.org/ticket/781#comment:10>
Xapian <https://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list