diff --git a/sqlitecluster/SQLiteNode.cpp b/sqlitecluster/SQLiteNode.cpp index 32f86efda..8228d29ee 100644 --- a/sqlitecluster/SQLiteNode.cpp +++ b/sqlitecluster/SQLiteNode.cpp @@ -2083,6 +2083,8 @@ void SQLiteNode::_changeState(SQLiteNodeState newState, uint64_t commitIDToCance } } +static int __ATTEMPTS = 0; + void SQLiteNode::_queueSynchronize(const SQLiteNode* const node, SQLitePeer* peer, SQLite& db, SData& response, bool sendAll) { // We need this to check the state of the node, and we also need `name` to make the logging macros work in a static // function. However, if you pass a null pointer here, we can't set these, so we'll fail. We also can't log that, @@ -2139,7 +2141,12 @@ void SQLiteNode::_queueSynchronize(const SQLiteNode* const node, SQLitePeer* pee // We set this for all commits because this only gets all commits in response to SUBSCRIBE, which is done synchronously, and blocks the commit thread. // For asynchronous queries, there's nothing being blocked, so it doesn't much matter how long these take. // This is really not the correct encapsulation for this, but we can improve that later. - timeoutLimitUS = 100; + if (__ATTEMPTS) { + timeoutLimitUS = 10'000; + } else { + timeoutLimitUS = 100; + } + __ATTEMPTS++; } else { toIndex = min(toIndex, fromIndex + 100); // 100 transactions at a time }