Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-31627 Remove legacy central node delay #18775

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 2 additions & 26 deletions system/jlib/jsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,6 @@ struct xfd_set { __fd_mask fds_bits[XFD_SETSIZE / __NFDBITS]; }; // define our o
#define T_SOCKET int
#define SEND_FLAGS (MSG_NOSIGNAL)
#endif
#ifdef CENTRAL_NODE_RANDOM_DELAY
static SocketEndpointArray CentralNodeArray;
#endif
enum SOCKETMODE { sm_tcp_server, sm_tcp, sm_udp_server, sm_udp, sm_multicast_server, sm_multicast};

#define BADSOCKERR(err) ((err==JSE_BADF)||(err==JSE_NOTSOCK))
Expand Down Expand Up @@ -1538,20 +1535,8 @@ void CSocket::connect_wait(unsigned timems)
bool exit = false;
int err;
unsigned refuseddelay = 1;
while (!exit) {
#ifdef CENTRAL_NODE_RANDOM_DELAY
ForEachItemIn(cn,CentralNodeArray) {
const SocketEndpoint &ep=CentralNodeArray.item(cn);
if (ep.ipequals(targetip)) {
unsigned sleeptime = getRandom() % 1000;
StringBuffer s;
ep.getHostText(s);
DBGLOG("Connection to central node %s - sleeping %d milliseconds", s.str(), sleeptime);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I've ever seen this log message before ?
Probably there to avoid dropping SYNs when many connects at the same time ??
Increasing kernel somaxconn and application listen queues should help this.

Sleep(sleeptime);
break;
}
}
#endif
while (!exit)
{
unsigned remaining;
exit = tm.timedout(&remaining);
bool blockselect = exit; // if last time round block
Expand Down Expand Up @@ -6189,15 +6174,6 @@ ISocketBufferReader *createSocketBufferReader(const char *trc)
}


extern jlib_decl void markNodeCentral(SocketEndpoint &ep)
{
#ifdef CENTRAL_NODE_RANDOM_DELAY
CriticalBlock block(CSocket::crit);
CentralNodeArray.append(ep);
#endif
}


static CSocket *prepareSocket(unsigned idx,const SocketEndpoint &ep, ISocketConnectNotify &inotify)
{
Owned<CSocket> sock = new CSocket(ep,sm_tcp,NULL);
Expand Down
3 changes: 0 additions & 3 deletions system/jlib/jsocket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ enum JSOCKET_ERROR_CODES {

#ifndef _WIN32
#define BLOCK_POLLED_SINGLE_CONNECTS // NB this is much slower in windows
#define CENTRAL_NODE_RANDOM_DELAY
#else
#define USERECVSEM // to singlethread BF_SYNC_TRANSFER_PUSH
#endif
Expand Down Expand Up @@ -633,8 +632,6 @@ interface ISocketBufferReader: extends IInterface

extern jlib_decl ISocketBufferReader *createSocketBufferReader(const char *trc=NULL);

extern jlib_decl void markNodeCentral(SocketEndpoint &ep); // random delay for linux

interface ISocketConnectNotify
{
public:
Expand Down
1 change: 0 additions & 1 deletion thorlcr/slave/thslavemain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ int main( int argc, const char *argv[] )
SocketEndpoint masterEp(master);
localHostToNIC(masterEp);
setMasterPortBase(masterEp.port);
markNodeCentral(masterEp);

if (RegisterSelf(masterEp))
{
Expand Down
Loading