From abbdea74652213df548874b03cd5175665279bfa Mon Sep 17 00:00:00 2001 From: MutableFire Date: Wed, 24 Jun 2026 12:04:14 +0300 Subject: [PATCH 1/2] Enhancement: Remove redundant return statements in UDP interconnect code In C, reaching the closing brace of a void function implicitly returns control to the caller. Explicit 'return;' statements in these positions are unnecessary noise that clutters the code. Removing them aligns the code with common C style guidelines and improves readability. --- contrib/interconnect/udp/ic_udpifc.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/contrib/interconnect/udp/ic_udpifc.c b/contrib/interconnect/udp/ic_udpifc.c index 47c6273470c..821ec7ddd6f 100644 --- a/contrib/interconnect/udp/ic_udpifc.c +++ b/contrib/interconnect/udp/ic_udpifc.c @@ -1381,8 +1381,6 @@ addCursorIcEntry(CursorICHistoryTable *t, uint32 icId, uint32 cid) t->count++; elog(DEBUG2, "add icid %d cid %d status %d", p->icId, p->cid, p->status); - - return; } /* @@ -1770,7 +1768,6 @@ setupUDPListeningSocket(int *listenerSocketFd, int32 *listenerPort, int *txFamil (errcode(ERRCODE_GP_INTERCONNECTION_ERROR), errmsg("interconnect error: Could not set up udp listener socket"), errdetail("%s: %m", fun))); - return; } /* @@ -1806,8 +1803,6 @@ ic_set_pthread_sigmasks(sigset_t *old_sigs) #else (void) old_sigs; #endif - - return; } static void @@ -1822,8 +1817,6 @@ ic_reset_pthread_sigmasks(sigset_t *sigs) #else (void) sigs; #endif - - return; } void @@ -1945,7 +1938,6 @@ InitMotionUDPIFC(int *listenerSocketFd, int32 *listenerPort) } ic_control_info.threadCreated = true; - return; } void @@ -2175,8 +2167,6 @@ connDelHash(ConnHashTable *ht, MotionConn *mConn) free(trash); ic_statistics.activeConnectionsNum--; - - return; } /* @@ -4878,8 +4868,6 @@ markUDPConnInactiveIFC(MotionConn *conn) pthread_mutex_lock(&ic_control_info.lock); conn->stillActive = false; pthread_mutex_unlock(&ic_control_info.lock); - - return; } void @@ -4918,8 +4906,6 @@ DeregisterReadInterestUDP(ChunkTransportState *transportStates, elog(LOG, "deregisterReadInterest set stillactive = false for node %d route %d (%s)", motNodeID, srcRoute, reason); #endif markUDPConnInactiveIFC(conn); - - return; } @@ -5509,8 +5495,6 @@ sendOnce(ChunkTransportState *transportStates, ChunkTransportStateEntry *pChunkE logPkt("PKT DETAILS ", buf->pkt); #endif } - - return; } @@ -8208,7 +8192,6 @@ SendDummyPacket(void) pg_freeaddrinfo_all(hint.ai_family, addrs); if (sockfd != -1) closesocket(sockfd); - return; } void logChunkParseDetails(MotionConn *conn, uint32 ic_instance_id) From bfde4bcf394a138251a6585de46c3b1eceeaa6ef Mon Sep 17 00:00:00 2001 From: MutableFire Date: Fri, 26 Jun 2026 17:39:23 +0300 Subject: [PATCH 2/2] FIX: Reinstate returns --- contrib/interconnect/udp/ic_udpifc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/interconnect/udp/ic_udpifc.c b/contrib/interconnect/udp/ic_udpifc.c index 821ec7ddd6f..0f26d73f936 100644 --- a/contrib/interconnect/udp/ic_udpifc.c +++ b/contrib/interconnect/udp/ic_udpifc.c @@ -2167,6 +2167,8 @@ connDelHash(ConnHashTable *ht, MotionConn *mConn) free(trash); ic_statistics.activeConnectionsNum--; + + return; } /* @@ -4906,6 +4908,8 @@ DeregisterReadInterestUDP(ChunkTransportState *transportStates, elog(LOG, "deregisterReadInterest set stillactive = false for node %d route %d (%s)", motNodeID, srcRoute, reason); #endif markUDPConnInactiveIFC(conn); + + return; } @@ -5495,6 +5499,8 @@ sendOnce(ChunkTransportState *transportStates, ChunkTransportStateEntry *pChunkE logPkt("PKT DETAILS ", buf->pkt); #endif } + + return; }