impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5499: avoid ephemeral port conflicts
Date Tue, 13 Jun 2017 21:23:11 GMT
Tim Armstrong has posted comments on this change.

Change subject: IMPALA-5499: avoid ephemeral port conflicts

Patch Set 2:

File be/src/statestore/

Line 76:   int subscriber_port = FindUnusedEphemeralPort(&used_ports);
> you could assert that used_ports.back() == subscriber_port here and elsewhe
Is this the right place for it? Seems more like a unit test for FindUnusedEphemeralPort()
than an invariant of this function. I can add a unit test for the function but unsure if it's
worth it.
File be/src/util/

Line 197:     }
> Should'nt we increment tries here?
Changed back to a for() loop, which achieves the same thing. I was thinking that it was a
bit weird to fail randomly because we picked numbers that were already used, but I guess it's
no different from failing because the port was in use for other reasons.

Line 206:   close(sockfd);
> Shouldn't this be above the continue, possibly at the start of the loop? Ot
File be/src/util/network-util.h:

Line 70: int FindUnusedEphemeralPort(std::vector<int>* used_ports);
> You could make this default to nullptr.
I hit a compile error that I couldn't get around. Unsure if it's a compiler bug or something
else but my inclination is to not spend time digging into it.

   error: default argument given for parameter 1 of ‘int impala::FindUnusedEphemeralPort(std::vector<int>*)’
 int FindUnusedEphemeralPort(std::vector<int>* used_ports = nullptr);

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: Id02c83e6f946a14b83f5e6561957d7ad81442835
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tim Armstrong <>
Gerrit-Reviewer: Lars Volker <>
Gerrit-Reviewer: Sailesh Mukil <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-Reviewer: anujphadke <>
Gerrit-HasComments: Yes

View raw message