[CDRIVER-2996] AIX failed unit tests Created: 06/Mar/19 Updated: 05/Feb/24 Resolved: 05/Feb/24 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | 1.14.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Amy Giersch | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | bg-rf | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
AIX 7.1 |
||
| Attachments: |
|
| Epic Link: | CDRIVER-2733 |
| Description |
|
Failed unit tests on AIX for 1.14.0 (these failures are consistent since at least 1.12.0 - some of the socket ones since 1.7ish) cmake -DENABLE_SRV=OFF -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF .. Output from failed unit tests is attached. Tests are failing for 2 reasons: #1 AIX poll function does not set POLLHUP in revents For reference, AIX poll function. Taking the first test as an example, the sequence: Created quick reference code (attached) to connect to localhost on a port with nothing there followed by a poll request to see the difference between AIX and Redhat: ON AIX – 79 is ECONNREFUSED ON REDHAT – 115 is EINPROGRESS Changing localhost to somewhere else, it returns EINPROGRESS on connect, but does not set POLLHUP, however the socket error is set to ECONNREFUSED. As a workaround, I patched mongoc-socket.c to check the last socket error after calling poll and if it is ECONNREFUSED to set POLLHUP in the revents returned for the stream so that it will follow the expected path when the connection is refused on the initial connection. The diff is attached. This fixed all of the test cases listed above. Any feedback on this workaround or alternative suggestions? #2 getaddrinfo() not returning ipv6 sorted before ipv4 The unit tests assume getaddrinfo() will return the results sorted with ipv6 before ipv4 as the connections are attempted in that order. The ordering though is configurable (gai.conf for example). For some (undetermined) reason, results for localhost are coming back ipv4 before ipv6 when call getaddrinfo(). To confirm that the ordering from getaddrinfo() is causing these unit tests to fail I (temporarily) modified mongoc-topology-scanner.c to try ipv6 before ipv4 and the tests passed. These failures look to be due to configuration in our environment. No real question here other than maybe the unit tests should check the assumption about the ordering of results from getaddrinfo()? |
| Comments |
| Comment by Rishabh Bisht [ 05/Feb/24 ] |
|
Closing as won't do as we can't test AIX. If this is still an issue for you, please feel free to submit a pull request. Thanks. |