Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error_injection: replace boost::lexical_cast with std::from_chars #22164

Merged

Conversation

avikivity
Copy link
Member

@avikivity avikivity commented Jan 3, 2025

Replace boost with a standard facility; this reduces dependencies as lexical_cast depends on boost ranges.

Since std::from_chars() is chatty, we introduce utils::from_chars_exactly() to trade some flexibility for conciseness.

Small build time improvement, no backport needed.

@scylladb-promoter
Copy link
Contributor

🔴 CI State: FAILURE

✅ - Build
✅ - dtest with topology changes
✅ - Docker Test
✅ - dtest
✅ - dtest with tablets
✅ - Offline-installer Artifact Tests
❌ - Unit Tests

Failed Tests (2/35576):

Build Details:

  • Duration: 8 hr 4 min
  • Builder: i-07307d6d16b044b46 (m5ad.8xlarge)

@tchaikov
Copy link
Contributor

tchaikov commented Jan 5, 2025

@scylladb-promoter
Copy link
Contributor

🔴 CI State: FAILURE

✅ - Build
❌ - Docker Test
✅ - dtest with tablets
❌ - Offline-installer Artifact Tests
✅ - dtest
✅ - dtest with topology changes
✅ - Unit Tests

Build Details:

  • Duration: 3 hr 59 min
  • Builder: spider2.cloudius-systems.com

@avikivity
Copy link
Member Author

@yaronkaikov what can I do about the offline installer failures?

@mykaul
Copy link
Contributor

mykaul commented Jan 5, 2025

@yaronkaikov what can I do about the offline installer failures?

It's scylladb/scylla-cluster-tests#9645

Generally, I think it's wrong to run them in CI.

@yaronkaikov
Copy link
Contributor

@yaronkaikov what can I do about the offline installer failures?

It's scylladb/scylla-cluster-tests#9645

Generally, I think it's wrong to run them in CI.

Well, just not long ago, we had a regression that took us a few months to fix.

@mykaul
Copy link
Contributor

mykaul commented Jan 5, 2025

@yaronkaikov what can I do about the offline installer failures?

It's scylladb/scylla-cluster-tests#9645
Generally, I think it's wrong to run them in CI.

Well, just not long ago, we had a regression that took us a few months to fix.

Run it nightly, or on next. Nor per PR.

@yaronkaikov
Copy link
Contributor

@yaronkaikov what can I do about the offline installer failures?

It's scylladb/scylla-cluster-tests#9645
Generally, I think it's wrong to run them in CI.

Well, just not long ago, we had a regression that took us a few months to fix.

Run it nightly, or on next. Nor per PR.

This is what we were doing, before (nightly) and it didn't help us much

About running in next , i guess it's a good solution, just need @avikivity to agree

@@ -13,6 +13,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/range/join.hpp>
#include <boost/lexical_cast.hpp>
Copy link
Member

Choose a reason for hiding this comment

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

Why not convert the error injection point in override_snapshot_thresholds too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I want to keep the patch localized and not grow it.

@avikivity
Copy link
Member Author

About running in next , i guess it's a good solution, just need @avikivity to agree

Ok with that.

@avikivity
Copy link
Member Author

Docker test failed too. What can I do to make CI pass?

@yaronkaikov
Copy link
Contributor

Docker test failed too. What can I do to make CI pass?

It failed due to scylladb/scylla-cluster-tests#9645 @fruch any idea what is going on ?

@avikivity
Copy link
Member Author

Since podman now supports nested containers, perhaps we can test the container image in test.py.

@fruch
Copy link
Contributor

fruch commented Jan 5, 2025

Since podman now supports nested containers, perhaps we can test the container image in test.py.

those tests are not just for docker image...

@avikivity
Copy link
Member Author

We can test other packages too in containers.

@scylladb-promoter
Copy link
Contributor

🟢 CI State: SUCCESS

✅ - Build
✅ - dtest with tablets
✅ - dtest
✅ - dtest with topology changes
✅ - Offline-installer Artifact Tests
✅ - Docker Test
✅ - Unit Tests

Build Details:

  • Duration: 4 hr 0 min
  • Builder: spider5.cloudius-systems.com

Copy link
Contributor

@tchaikov tchaikov left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -163,7 +161,14 @@ class error_injection {
if constexpr (std::is_same_v<T, std::string_view>) {
return s;
} else {
return boost::lexical_cast<T>(s.data(), s.size());
Copy link
Contributor

Choose a reason for hiding this comment

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

you replaced 1 line of code with 8 lines of code. I think it's a change for the worse.
Would be better if those 8 lines were extracted to a utility template function

Copy link
Member Author

Choose a reason for hiding this comment

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

std::from_chars interface is quite chatty, since it tries to be more flexible than lexical_cast.

I'll see if I can improve it.

@avikivity avikivity force-pushed the error_injection-lexical_cast branch from 5e54b22 to b7c8d91 Compare January 8, 2025 12:21
@avikivity
Copy link
Member Author

v2: introduce from_chars_exactly() to reduce noise

utils/from_chars_exactly.hh Outdated Show resolved Hide resolved
@scylladb-promoter
Copy link
Contributor

🔴 CI State: FAILURE

✅ - Build
✅ - dtest with tablets
✅ - Docker Test
✅ - dtest
❌ - dtest with topology changes
✅ - Offline-installer Artifact Tests
✅ - Unit Tests

Failed Tests (1/36895):

Build Details:

  • Duration: 9 hr 16 min
  • Builder: spider6.cloudius-systems.com

This is a replacement for boost::lexical_cast (but without its
long dependency chain). It wraps std::from_chars(), providing a less
flexible but also more concise interface.
Replace boost with a standard facility; this reduces dependencies
as lexical_cast depends on boost ranges.

As a side effect the exception error message is improved.
@avikivity avikivity force-pushed the error_injection-lexical_cast branch from b7c8d91 to 9ff6473 Compare January 9, 2025 09:14
@avikivity
Copy link
Member Author

v3: improve license for new file

@scylladb-promoter
Copy link
Contributor

🟢 CI State: SUCCESS

✅ - Build
✅ - dtest with tablets
✅ - dtest
✅ - dtest with topology changes
✅ - Offline-installer Artifact Tests
✅ - Docker Test
✅ - Unit Tests

Build Details:

  • Duration: 8 hr 27 min
  • Builder: i-00c32e22ea3a23a21 (m5ad.8xlarge)

@avikivity
Copy link
Member Author

@nyh ping for merge

@scylladb-promoter scylladb-promoter merged commit 31c6a33 into scylladb:master Jan 13, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/none Backport is not required promoted-to-master
Projects
None yet
Development

Successfully merging this pull request may close these issues.