Skip to content

Conversation

@bneradt
Copy link
Contributor

@bneradt bneradt commented Feb 27, 2024

Before this PR, we had pulled in libswoc's production source code into ATS. But we had not done the same with the libswoc unit tests. This ports libswoc unit_tests into ATS and ties it into our cmake system so that they are built and run as a part of ATS unit tests.

@bneradt bneradt added this to the 10.1.0 milestone Feb 27, 2024
@bneradt bneradt requested a review from traeak February 27, 2024 21:36
@bneradt bneradt self-assigned this Feb 27, 2024
Adds libswoc unit_tests and updates the lib/swoc/CMakeLists.txt to build them.
@bneradt bneradt force-pushed the add_libswoc_unit_tests branch from ed356a4 to 782b1ca Compare February 28, 2024 00:45
@bneradt bneradt marked this pull request as ready for review February 28, 2024 00:45
@bneradt bneradt force-pushed the add_libswoc_unit_tests branch from 782b1ca to f3308be Compare February 28, 2024 01:14
Updating the unit_tests for newer compilers and to make the tests run
more generally without assuming they were runned from a particular
location.
@bneradt bneradt force-pushed the add_libswoc_unit_tests branch from f3308be to 524087b Compare February 28, 2024 18:52
Reverting back IntrusiveHashMap::insert ordering so that it puts things
at the end of the list when there is a colision.

Fix HttpSessionManager to walk the connection pool backwards.
@bneradt bneradt force-pushed the add_libswoc_unit_tests branch from 524087b to 4ffc766 Compare February 28, 2024 20:58
Comment on lines +517 to +525
if (spot != limit) {
// If an equal key was found, walk past those to insert at the upper end of the range.
do {
spot = H::next_ptr(spot);
} while (spot != limit && H::equal(key, H::key_of(spot)));
if (spot != limit) { // something not equal past last equivalent, it's going to be mixed.
mixed_p = true;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This puts back what we reverted because origin side session pooling was broken by it. See #10992 where we pulled this out.

To address the functional concerns, see my patch below in HttpSessionManager.cc

TextView::suffix_at(char c) const {
self_type zret;
if (auto n = this->rfind(c); n != npos) {
if (auto n = this->rfind(c); n != npos && n + 1 < this->size()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addresses a compiler warning from Centos that zret.assign referenced the byte after data() if n pointed to the last byte in the string.

Copy link
Contributor

@traeak traeak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These all look fine and the reverting of the IPRange and adjustments to HttpSessionManager look fine.

@bneradt bneradt merged commit 20bae7f into apache:master Feb 29, 2024
@bneradt bneradt deleted the add_libswoc_unit_tests branch February 29, 2024 19:07
cmcfarlen pushed a commit that referenced this pull request Mar 1, 2024
Before this PR, we had pulled in libswoc's production source code into ATS. But we had not done the same with the libswoc unit tests. This ports libswoc unit_tests into ATS and ties it into our cmake system so that they are built and run as a part of ATS unit tests.

(cherry picked from commit 20bae7f)
@cmcfarlen
Copy link
Contributor

Cherry-picked to v10.0.x

@cmcfarlen cmcfarlen modified the milestones: 10.1.0, 10.0.0 Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants