Apply code review feedback

preventConflictingFlags
Onder Kalaci 2020-04-08 18:11:42 +02:00
parent af587edea1
commit f3394b2283
2 changed files with 6 additions and 3 deletions

View File

@ -328,6 +328,9 @@ StartNodeUserDatabaseConnection(uint32 flags, const char *hostname, int32 port,
sizeof(MultiConnection));
dlist_push_tail(entry->connections, &connection->connectionNode);
/* these two flags are by nature cannot happen at the same time */
Assert((flags & OPTIONAL_CONNECTION) && (flags & WAIT_FOR_CONNECTION));
if (flags & WAIT_FOR_CONNECTION)
{
WaitLoopForSharedConnection(hostname, port);

View File

@ -288,9 +288,9 @@ WaitLoopForSharedConnection(const char *hostname, int port)
* connection counter for the given nodeId and the current database in
* SharedConnStatsHash.
*
* The function first checks whether the number of connections is less than
* citus.max_shared_pool_size. If so, the function increments the counter
* by one and returns true. Else, the function returns false.
* If the function returns true, the caller is allowed (and expected)
* to establish a new connection to the given node. Else, the caller
* is not allowed to establish a new connection.
*/
bool
TryToIncrementSharedConnectionCounter(const char *hostname, int port)