-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore responses with unexpected IDs (#1155)
* Ignore replies with unexpected IDs This fixes the following problem: At time 0, we send a query with ID X from port P. At time T, we time out the query due to lack of response, and then send a different query with ID Y. By coincidence, the new query is sent from the same port number P (since port numbers are only 16 bits, this can happen with non-negligible probability when making queries at a high rate). At time T+epsilon, we receive a response to the original query. Since the ID in this response is X, not Y, we would previously return ErrId, preventing the second query from succeeding. With this commit, we simply ignore the response with the mismatched ID and return once we receive the response with the correct ID. * Update test for bad ID The new test sends two replies: the first one has a bad ID, which should be ignored, and the second one has the correct ID. * Add test to ensure query times out when server returns bad ID * Avoid use of error string matching in test case * Check for mismatched query IDs when using TCP * Reduce timeout in TestClientSyncBadID
- Loading branch information
Showing
3 changed files
with
91 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters