Skip to content

rgw/beast: optimizations for request timeout - #43761

Merged
cbodley merged 6 commits into
ceph:masterfrom
cbodley:wip-beast-timeout-alloc
Nov 15, 2021
Merged

cbodley merged 6 commits into
ceph:masterfrom
cbodley:wip-beast-timeout-alloc

Conversation

@cbodley

@cbodley cbodley commented Nov 1, 2021 •

Copy link
Copy Markdown
Contributor

3 separate performance optimizations for the beast frontend, described in https://tracker.ceph.com/issues/52333#note-13

  • commits 2 and 3 replace the polymorphic boost::asio::executor with the concrete boost::asio::io_context::executor_type type. this eliminates one allocation for the initial type-erasure, along with the ongoing overhead of virtual functions

  • commit 4 replaces the use of boost::beast::tcp_stream for request timeouts with manual timeouts based on boost::asio::basic_waitable_timer. this lets us plug in the ceph::coarse_mono_clock which is cheaper to sample than the std::chrono::steady_clock

* commit 5 adds a thread-safe allocator for timout completion handlers. each time we perform i/o on the stream, we call basic_waitable_timer::async_wait() to rearm this timeout. async_wait() has to allocate memory for its completion handler, which is our struct timeout_handler wrapped in boost's own boost::asio::detail::wait_handler<T>

commit 6 adds some log output to help with allocator debugging, but shouldn't be included for benchmarks

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@mkogan1 mkogan1 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

benchmarked performance (without the rgw/beast: timer pool logs with DoutPrefixProvider commit)
the results are very good, table of IO/s per branches and request_timeout_ms:

+--------------------------+-------------------------+--------+
|            IO/s          | wip-beast-timeout-alloc | master |
+--------------------------+-------------------------+--------+
| request_timeout_ms=65000 | 415                     | 375    |
+--------------------------+-------------------------+--------+
| request_timeout_ms=0     | 421                     | 412    |
+--------------------------+-------------------------+--------+

(benchmarked on the same environment as previous tests o07 sepia machine)

@markhpc

markhpc commented Nov 4, 2021

Copy link
Copy Markdown
Member

@mkogan1 Did you happen to grab CPU usage metrics when you ran your tests? I'd be curious to see if we also so a drop in overhead.

@mkogan1

mkogan1 commented Nov 8, 2021

Copy link
Copy Markdown
Contributor

@mkogan1 Did you happen to grab CPU usage metrics when you ran your tests? I'd be curious to see if we also so a drop in overhead.

did another quick CPU usage collection

image

hsbench results in chronological order from left to right:

❯ numactl -N 1 -m 1 -- ~/go/bin/hsbench -a b2345678901234567890 -s b234567890123456789012345678901234567890 -u http://127.0.0.1:8000 -z 4M -d -1 -t 8 -b 8 -n 5000 -m g -bp b01b |& tee hsbench.log | stdbuf -oL -eL colrm 128 | ccze -Aonolookups
2021/11/08 15:37:03 Hotsauce S3 Benchmark Version 0.1 
2021/11/08 15:37:03 Parameters: 
2021/11/08 15:37:03 url=http://127.0.0.1:8000 
2021/11/08 15:37:03 object_prefix= 
2021/11/08 15:37:03 bucket_prefix=b01b 
2021/11/08 15:37:03 region=us-east-1 
2021/11/08 15:37:03 modes=g 
2021/11/08 15:37:03 output= 
2021/11/08 15:37:03 json_output= 
2021/11/08 15:37:03 max_keys=1000 
2021/11/08 15:37:03 object_count=5000 
2021/11/08 15:37:03 bucket_count=8 
2021/11/08 15:37:03 duration=-1 
2021/11/08 15:37:03 threads=8 
2021/11/08 15:37:03 loops=1 
2021/11/08 15:37:03 size=4M 
2021/11/08 15:37:03 interval=1.000000 
2021/11/08 15:37:03 Running Loop 0 OBJECT GET TEST 
2021/11/08 15:37:04 Loop: 0, Int: 0, Dur(s): 1.0, Mode: GET, Ops: 382, MB/s: 1528.00, IO/s: 382, Lat(ms): [ min: 10.7, avg: 19. 
2021/11/08 15:37:05 Loop: 0, Int: 1, Dur(s): 1.0, Mode: GET, Ops: 413, MB/s: 1652.00, IO/s: 413, Lat(ms): [ min: 10.9, avg: 17. 
2021/11/08 15:37:06 Loop: 0, Int: 2, Dur(s): 1.0, Mode: GET, Ops: 400, MB/s: 1600.00, IO/s: 400, Lat(ms): [ min: 9.8, avg: 18.3 
2021/11/08 15:37:07 Loop: 0, Int: 3, Dur(s): 1.0, Mode: GET, Ops: 419, MB/s: 1676.00, IO/s: 419, Lat(ms): [ min: 9.7, avg: 17.5 
2021/11/08 15:37:08 Loop: 0, Int: 4, Dur(s): 1.0, Mode: GET, Ops: 421, MB/s: 1684.00, IO/s: 421, Lat(ms): [ min: 8.5, avg: 17.3 
2021/11/08 15:37:09 Loop: 0, Int: 5, Dur(s): 1.0, Mode: GET, Ops: 427, MB/s: 1708.00, IO/s: 427, Lat(ms): [ min: 9.9, avg: 17.1 
2021/11/08 15:37:10 Loop: 0, Int: 6, Dur(s): 1.0, Mode: GET, Ops: 415, MB/s: 1660.00, IO/s: 415, Lat(ms): [ min: 10.1, avg: 17. 
2021/11/08 15:37:11 Loop: 0, Int: 7, Dur(s): 1.0, Mode: GET, Ops: 431, MB/s: 1724.00, IO/s: 431, Lat(ms): [ min: 9.0, avg: 16.8 
2021/11/08 15:37:12 Loop: 0, Int: 8, Dur(s): 1.0, Mode: GET, Ops: 424, MB/s: 1696.00, IO/s: 424, Lat(ms): [ min: 10.4, avg: 17. 
2021/11/08 15:37:13 Loop: 0, Int: 9, Dur(s): 1.0, Mode: GET, Ops: 413, MB/s: 1652.00, IO/s: 413, Lat(ms): [ min: 10.1, avg: 17. 
2021/11/08 15:37:14 Loop: 0, Int: 10, Dur(s): 1.0, Mode: GET, Ops: 418, MB/s: 1672.00, IO/s: 418, Lat(ms): [ min: 9.9, avg: 17. 
2021/11/08 15:37:15 Loop: 0, Int: 11, Dur(s): 1.0, Mode: GET, Ops: 412, MB/s: 1648.00, IO/s: 412, Lat(ms): [ min: 9.1, avg: 17. 
2021/11/08 15:37:15 Loop: 0, Int: TOTAL, Dur(s): 12.1, Mode: GET, Ops: 5000, MB/s: 1653.02, IO/s: 413, Lat(ms): [ min: 8.5, avg 
❯ numactl -N 1 -m 1 -- ~/go/bin/hsbench -a b2345678901234567890 -s b234567890123456789012345678901234567890 -u http://127.0.0.1:8000 -z 4M -d -1 -t 8 -b 8 -n 5000 -m g -bp b01b |& tee hsbench.log | stdbuf -oL -eL colrm 128 | ccze -Aonolookups
2021/11/08 15:37:50 Hotsauce S3 Benchmark Version 0.1 
2021/11/08 15:37:50 Parameters: 
2021/11/08 15:37:50 url=http://127.0.0.1:8000 
2021/11/08 15:37:50 object_prefix= 
2021/11/08 15:37:50 bucket_prefix=b01b 
2021/11/08 15:37:50 region=us-east-1 
2021/11/08 15:37:50 modes=g 
2021/11/08 15:37:50 output= 
2021/11/08 15:37:50 json_output= 
2021/11/08 15:37:50 max_keys=1000 
2021/11/08 15:37:50 object_count=5000 
2021/11/08 15:37:50 bucket_count=8 
2021/11/08 15:37:50 duration=-1 
2021/11/08 15:37:50 threads=8 
2021/11/08 15:37:50 loops=1 
2021/11/08 15:37:50 size=4M 
2021/11/08 15:37:50 interval=1.000000 
2021/11/08 15:37:50 Running Loop 0 OBJECT GET TEST 
2021/11/08 15:37:51 Loop: 0, Int: 0, Dur(s): 1.0, Mode: GET, Ops: 402, MB/s: 1608.00, IO/s: 402, Lat(ms): [ min: 10.8, avg: 18. 
2021/11/08 15:37:52 Loop: 0, Int: 1, Dur(s): 1.0, Mode: GET, Ops: 427, MB/s: 1708.00, IO/s: 427, Lat(ms): [ min: 10.0, avg: 17. 
2021/11/08 15:37:53 Loop: 0, Int: 2, Dur(s): 1.0, Mode: GET, Ops: 437, MB/s: 1748.00, IO/s: 437, Lat(ms): [ min: 10.1, avg: 16. 
2021/11/08 15:37:54 Loop: 0, Int: 3, Dur(s): 1.0, Mode: GET, Ops: 435, MB/s: 1740.00, IO/s: 435, Lat(ms): [ min: 9.4, avg: 16.7 
2021/11/08 15:37:55 Loop: 0, Int: 4, Dur(s): 1.0, Mode: GET, Ops: 447, MB/s: 1788.00, IO/s: 447, Lat(ms): [ min: 9.5, avg: 16.3 
2021/11/08 15:37:56 Loop: 0, Int: 5, Dur(s): 1.0, Mode: GET, Ops: 426, MB/s: 1704.00, IO/s: 426, Lat(ms): [ min: 9.9, avg: 17.0 
2021/11/08 15:37:57 Loop: 0, Int: 6, Dur(s): 1.0, Mode: GET, Ops: 428, MB/s: 1712.00, IO/s: 428, Lat(ms): [ min: 9.7, avg: 16.8 
2021/11/08 15:37:58 Loop: 0, Int: 7, Dur(s): 1.0, Mode: GET, Ops: 425, MB/s: 1700.00, IO/s: 425, Lat(ms): [ min: 10.7, avg: 17. 
2021/11/08 15:37:59 Loop: 0, Int: 8, Dur(s): 1.0, Mode: GET, Ops: 432, MB/s: 1728.00, IO/s: 432, Lat(ms): [ min: 10.2, avg: 16. 
2021/11/08 15:38:00 Loop: 0, Int: 9, Dur(s): 1.0, Mode: GET, Ops: 431, MB/s: 1724.00, IO/s: 431, Lat(ms): [ min: 10.3, avg: 16. 
2021/11/08 15:38:01 Loop: 0, Int: 10, Dur(s): 1.0, Mode: GET, Ops: 425, MB/s: 1700.00, IO/s: 425, Lat(ms): [ min: 9.5, avg: 17. 
2021/11/08 15:38:02 Loop: 0, Int: TOTAL, Dur(s): 11.7, Mode: GET, Ops: 5000, MB/s: 1708.41, IO/s: 427, Lat(ms): [ min: 9.4, avg 
❯ numactl -N 1 -m 1 -- ~/go/bin/hsbench -a b2345678901234567890 -s b234567890123456789012345678901234567890 -u http://127.0.0.1:8000 -z 4M -d -1 -t 8 -b 8 -n 5000 -m g -bp b01b |& tee hsbench.log | stdbuf -oL -eL colrm 128 | ccze -Aonolookups
2021/11/08 15:38:52 Hotsauce S3 Benchmark Version 0.1 
2021/11/08 15:38:52 Parameters: 
2021/11/08 15:38:52 url=http://127.0.0.1:8000 
2021/11/08 15:38:52 object_prefix= 
2021/11/08 15:38:52 bucket_prefix=b01b 
2021/11/08 15:38:52 region=us-east-1 
2021/11/08 15:38:52 modes=g 
2021/11/08 15:38:52 output= 
2021/11/08 15:38:52 json_output= 
2021/11/08 15:38:52 max_keys=1000 
2021/11/08 15:38:52 object_count=5000 
2021/11/08 15:38:52 bucket_count=8 
2021/11/08 15:38:52 duration=-1 
2021/11/08 15:38:52 threads=8 
2021/11/08 15:38:52 loops=1 
2021/11/08 15:38:52 size=4M 
2021/11/08 15:38:52 interval=1.000000 
2021/11/08 15:38:52 Running Loop 0 OBJECT GET TEST 
2021/11/08 15:38:53 Loop: 0, Int: 0, Dur(s): 1.0, Mode: GET, Ops: 359, MB/s: 1436.00, IO/s: 359, Lat(ms): [ min: 10.6, avg: 18. 
2021/11/08 15:38:54 Loop: 0, Int: 1, Dur(s): 1.0, Mode: GET, Ops: 376, MB/s: 1504.00, IO/s: 376, Lat(ms): [ min: 10.0, avg: 17. 
2021/11/08 15:38:55 Loop: 0, Int: 2, Dur(s): 1.0, Mode: GET, Ops: 374, MB/s: 1496.00, IO/s: 374, Lat(ms): [ min: 11.7, avg: 17. 
2021/11/08 15:38:56 Loop: 0, Int: 3, Dur(s): 1.0, Mode: GET, Ops: 388, MB/s: 1552.00, IO/s: 388, Lat(ms): [ min: 10.2, avg: 16. 
2021/11/08 15:38:57 Loop: 0, Int: 4, Dur(s): 1.0, Mode: GET, Ops: 376, MB/s: 1504.00, IO/s: 376, Lat(ms): [ min: 9.7, avg: 17.7 
2021/11/08 15:38:58 Loop: 0, Int: 5, Dur(s): 1.0, Mode: GET, Ops: 382, MB/s: 1528.00, IO/s: 382, Lat(ms): [ min: 9.8, avg: 17.3 
2021/11/08 15:38:59 Loop: 0, Int: 6, Dur(s): 1.0, Mode: GET, Ops: 378, MB/s: 1512.00, IO/s: 378, Lat(ms): [ min: 10.1, avg: 17. 
2021/11/08 15:39:00 Loop: 0, Int: 7, Dur(s): 1.0, Mode: GET, Ops: 365, MB/s: 1460.00, IO/s: 365, Lat(ms): [ min: 9.7, avg: 18.3 
2021/11/08 15:39:01 Loop: 0, Int: 8, Dur(s): 1.0, Mode: GET, Ops: 364, MB/s: 1456.00, IO/s: 364, Lat(ms): [ min: 11.9, avg: 18. 
2021/11/08 15:39:02 Loop: 0, Int: 9, Dur(s): 1.0, Mode: GET, Ops: 364, MB/s: 1456.00, IO/s: 364, Lat(ms): [ min: 10.9, avg: 18. 
2021/11/08 15:39:03 Loop: 0, Int: 10, Dur(s): 1.0, Mode: GET, Ops: 376, MB/s: 1504.00, IO/s: 376, Lat(ms): [ min: 9.8, avg: 17. 
2021/11/08 15:39:04 Loop: 0, Int: 11, Dur(s): 1.0, Mode: GET, Ops: 370, MB/s: 1480.00, IO/s: 370, Lat(ms): [ min: 11.1, avg: 18 
2021/11/08 15:39:05 Loop: 0, Int: 12, Dur(s): 1.0, Mode: GET, Ops: 382, MB/s: 1528.00, IO/s: 382, Lat(ms): [ min: 11.1, avg: 17 
2021/11/08 15:39:06 Loop: 0, Int: TOTAL, Dur(s): 13.4, Mode: GET, Ops: 5000, MB/s: 1494.68, IO/s: 374, Lat(ms): [ min: 9.7, avg 
❯ numactl -N 1 -m 1 -- ~/go/bin/hsbench -a b2345678901234567890 -s b234567890123456789012345678901234567890 -u http://127.0.0.1:8000 -z 4M -d -1 -t 8 -b 8 -n 5000 -m g -bp b01b |& tee hsbench.log | stdbuf -oL -eL colrm 128 | ccze -Aonolookups
2021/11/08 15:39:30 Hotsauce S3 Benchmark Version 0.1 
2021/11/08 15:39:30 Parameters: 
2021/11/08 15:39:30 url=http://127.0.0.1:8000 
2021/11/08 15:39:30 object_prefix= 
2021/11/08 15:39:30 bucket_prefix=b01b 
2021/11/08 15:39:30 region=us-east-1 
2021/11/08 15:39:30 modes=g 
2021/11/08 15:39:30 output= 
2021/11/08 15:39:30 json_output= 
2021/11/08 15:39:30 max_keys=1000 
2021/11/08 15:39:30 object_count=5000 
2021/11/08 15:39:30 bucket_count=8 
2021/11/08 15:39:30 duration=-1 
2021/11/08 15:39:30 threads=8 
2021/11/08 15:39:30 loops=1 
2021/11/08 15:39:30 size=4M 
2021/11/08 15:39:30 interval=1.000000 
2021/11/08 15:39:30 Running Loop 0 OBJECT GET TEST 
2021/11/08 15:39:31 Loop: 0, Int: 0, Dur(s): 1.0, Mode: GET, Ops: 389, MB/s: 1556.00, IO/s: 389, Lat(ms): [ min: 10.5, avg: 18. 
2021/11/08 15:39:32 Loop: 0, Int: 1, Dur(s): 1.0, Mode: GET, Ops: 435, MB/s: 1740.00, IO/s: 435, Lat(ms): [ min: 10.9, avg: 16. 
2021/11/08 15:39:33 Loop: 0, Int: 2, Dur(s): 1.0, Mode: GET, Ops: 418, MB/s: 1672.00, IO/s: 418, Lat(ms): [ min: 10.2, avg: 17. 
2021/11/08 15:39:34 Loop: 0, Int: 3, Dur(s): 1.0, Mode: GET, Ops: 445, MB/s: 1780.00, IO/s: 445, Lat(ms): [ min: 9.5, avg: 16.1 
2021/11/08 15:39:35 Loop: 0, Int: 4, Dur(s): 1.0, Mode: GET, Ops: 422, MB/s: 1688.00, IO/s: 422, Lat(ms): [ min: 10.0, avg: 17. 
2021/11/08 15:39:36 Loop: 0, Int: 5, Dur(s): 1.0, Mode: GET, Ops: 418, MB/s: 1672.00, IO/s: 418, Lat(ms): [ min: 10.0, avg: 17. 
2021/11/08 15:39:37 Loop: 0, Int: 6, Dur(s): 1.0, Mode: GET, Ops: 417, MB/s: 1668.00, IO/s: 417, Lat(ms): [ min: 10.8, avg: 17. 
2021/11/08 15:39:38 Loop: 0, Int: 7, Dur(s): 1.0, Mode: GET, Ops: 412, MB/s: 1648.00, IO/s: 412, Lat(ms): [ min: 10.1, avg: 17. 
2021/11/08 15:39:39 Loop: 0, Int: 8, Dur(s): 1.0, Mode: GET, Ops: 413, MB/s: 1652.00, IO/s: 413, Lat(ms): [ min: 9.4, avg: 17.4 
2021/11/08 15:39:40 Loop: 0, Int: 9, Dur(s): 1.0, Mode: GET, Ops: 424, MB/s: 1696.00, IO/s: 424, Lat(ms): [ min: 9.4, avg: 17.0 
2021/11/08 15:39:41 Loop: 0, Int: 10, Dur(s): 1.0, Mode: GET, Ops: 422, MB/s: 1688.00, IO/s: 422, Lat(ms): [ min: 9.7, avg: 17. 
2021/11/08 15:39:42 Loop: 0, Int: TOTAL, Dur(s): 11.9, Mode: GET, Ops: 5000, MB/s: 1681.10, IO/s: 420, Lat(ms): [ min: 9.4, avg 

@cbodley

cbodley commented Nov 8, 2021

Copy link
Copy Markdown
Contributor Author

thank you for the benchmarks @mkogan1!

the main thing i'd like to see before merge is a comparison with/without the "rgw/beast: add custom allocator for timeout handlers" commit. it adds some atomics for reference counting and allocation state, so it's hard to tell whether those costs outweigh the benefit of fewer heap allocations. if the custom allocator doesn't help much, i'd rather not merge that part

@mkogan1

mkogan1 commented Nov 8, 2021

Copy link
Copy Markdown
Contributor

thank you for the benchmarks @mkogan1!

the main thing i'd like to see before merge is a comparison with/without the "rgw/beast: add custom allocator for timeout handlers" commit. it adds some atomics for reference counting and allocation state, so it's hard to tell whether those costs outweigh the benefit of fewer heap allocations. if the custom allocator doesn't help much, i'd rather not merge that part

sure, just to make sure understood correctly - compare IO/s & CPU usage with and without commit 0f539b7 ?

@cbodley

cbodley commented Nov 8, 2021

Copy link
Copy Markdown
Contributor Author

sure, just to make sure understood correctly - compare IO/s & CPU usage with and without commit 0f539b7 ?

@mkogan1 yep!

@mkogan1

mkogan1 commented Nov 9, 2021

Copy link
Copy Markdown
Contributor

image
without commit 0f539b7 the CPU usage is slightly lower.

full hsbench logs in chronological order from left to right:

❯ numactl -N 1 -m 1 -- ~/go/bin/hsbench -a b2345678901234567890 -s b234567890123456789012345678901234567890 -u http://127.0.0.1:8000 -z 4M -d -1 -t 8 -b 8 -n 5000 -m g -bp b01b |& tee hsbench.log | stdbuf -oL -eL colrm 128 | ccze -Aonolookups
2021/11/09 12:56:21 Hotsauce S3 Benchmark Version 0.1 
2021/11/09 12:56:21 Parameters: 
2021/11/09 12:56:21 url=http://127.0.0.1:8000 
2021/11/09 12:56:21 object_prefix= 
2021/11/09 12:56:21 bucket_prefix=b01b 
2021/11/09 12:56:21 region=us-east-1 
2021/11/09 12:56:21 modes=g 
2021/11/09 12:56:21 output= 
2021/11/09 12:56:21 json_output= 
2021/11/09 12:56:21 max_keys=1000 
2021/11/09 12:56:21 object_count=5000 
2021/11/09 12:56:21 bucket_count=8 
2021/11/09 12:56:21 duration=-1 
2021/11/09 12:56:21 threads=8 
2021/11/09 12:56:21 loops=1 
2021/11/09 12:56:21 size=4M 
2021/11/09 12:56:21 interval=1.000000 
2021/11/09 12:56:21 Running Loop 0 OBJECT GET TEST 
2021/11/09 12:56:22 Loop: 0, Int: 0, Dur(s): 1.0, Mode: GET, Ops: 402, MB/s: 1608.00, IO/s: 402, Lat(ms): [ min: 10.9, avg: 18. 
2021/11/09 12:56:23 Loop: 0, Int: 1, Dur(s): 1.0, Mode: GET, Ops: 384, MB/s: 1536.00, IO/s: 384, Lat(ms): [ min: 11.1, avg: 17. 
2021/11/09 12:56:24 Loop: 0, Int: 2, Dur(s): 1.0, Mode: GET, Ops: 409, MB/s: 1636.00, IO/s: 409, Lat(ms): [ min: 10.7, avg: 19. 
2021/11/09 12:56:25 Loop: 0, Int: 3, Dur(s): 1.0, Mode: GET, Ops: 421, MB/s: 1684.00, IO/s: 421, Lat(ms): [ min: 10.5, avg: 17. 
2021/11/09 12:56:26 Loop: 0, Int: 4, Dur(s): 1.0, Mode: GET, Ops: 414, MB/s: 1656.00, IO/s: 414, Lat(ms): [ min: 10.2, avg: 17. 
2021/11/09 12:56:27 Loop: 0, Int: 5, Dur(s): 1.0, Mode: GET, Ops: 416, MB/s: 1664.00, IO/s: 416, Lat(ms): [ min: 8.6, avg: 17.5 
2021/11/09 12:56:28 Loop: 0, Int: 6, Dur(s): 1.0, Mode: GET, Ops: 418, MB/s: 1672.00, IO/s: 418, Lat(ms): [ min: 9.9, avg: 17.5 
2021/11/09 12:56:29 Loop: 0, Int: 7, Dur(s): 1.0, Mode: GET, Ops: 418, MB/s: 1672.00, IO/s: 418, Lat(ms): [ min: 10.8, avg: 17. 
2021/11/09 12:56:30 Loop: 0, Int: 8, Dur(s): 1.0, Mode: GET, Ops: 416, MB/s: 1664.00, IO/s: 416, Lat(ms): [ min: 9.8, avg: 17.6 
2021/11/09 12:56:31 Loop: 0, Int: 9, Dur(s): 1.0, Mode: GET, Ops: 410, MB/s: 1640.00, IO/s: 410, Lat(ms): [ min: 11.5, avg: 17. 
2021/11/09 12:56:32 Loop: 0, Int: 10, Dur(s): 1.0, Mode: GET, Ops: 414, MB/s: 1656.00, IO/s: 414, Lat(ms): [ min: 9.7, avg: 17. 
2021/11/09 12:56:33 Loop: 0, Int: 11, Dur(s): 1.0, Mode: GET, Ops: 426, MB/s: 1704.00, IO/s: 426, Lat(ms): [ min: 11.4, avg: 17 
2021/11/09 12:56:33 Loop: 0, Int: TOTAL, Dur(s): 12.1, Mode: GET, Ops: 5000, MB/s: 1649.72, IO/s: 412, Lat(ms): [ min: 8.6, avg 
❯ numactl -N 1 -m 1 -- ~/go/bin/hsbench -a b2345678901234567890 -s b234567890123456789012345678901234567890 -u http://127.0.0.1:8000 -z 4M -d -1 -t 8 -b 8 -n 5000 -m g -bp b01b |& tee hsbench.log | stdbuf -oL -eL colrm 128 | ccze -Aonolookups
2021/11/09 13:00:41 Hotsauce S3 Benchmark Version 0.1 
2021/11/09 13:00:41 Parameters: 
2021/11/09 13:00:41 url=http://127.0.0.1:8000 
2021/11/09 13:00:41 object_prefix= 
2021/11/09 13:00:41 bucket_prefix=b01b 
2021/11/09 13:00:41 region=us-east-1 
2021/11/09 13:00:41 modes=g 
2021/11/09 13:00:41 output= 
2021/11/09 13:00:41 json_output= 
2021/11/09 13:00:41 max_keys=1000 
2021/11/09 13:00:41 object_count=5000 
2021/11/09 13:00:41 bucket_count=8 
2021/11/09 13:00:41 duration=-1 
2021/11/09 13:00:41 threads=8 
2021/11/09 13:00:41 loops=1 
2021/11/09 13:00:41 size=4M 
2021/11/09 13:00:41 interval=1.000000 
2021/11/09 13:00:41 Running Loop 0 OBJECT GET TEST 
2021/11/09 13:00:42 Loop: 0, Int: 0, Dur(s): 1.0, Mode: GET, Ops: 388, MB/s: 1552.00, IO/s: 388, Lat(ms): [ min: 11.7, avg: 18. 
2021/11/09 13:00:43 Loop: 0, Int: 1, Dur(s): 1.0, Mode: GET, Ops: 369, MB/s: 1476.00, IO/s: 369, Lat(ms): [ min: 11.2, avg: 20. 
2021/11/09 13:00:44 Loop: 0, Int: 2, Dur(s): 1.0, Mode: GET, Ops: 399, MB/s: 1596.00, IO/s: 399, Lat(ms): [ min: 11.8, avg: 18. 
2021/11/09 13:00:45 Loop: 0, Int: 3, Dur(s): 1.0, Mode: GET, Ops: 406, MB/s: 1624.00, IO/s: 406, Lat(ms): [ min: 9.9, avg: 18.0 
2021/11/09 13:00:46 Loop: 0, Int: 4, Dur(s): 1.0, Mode: GET, Ops: 406, MB/s: 1624.00, IO/s: 406, Lat(ms): [ min: 10.5, avg: 18. 
2021/11/09 13:00:47 Loop: 0, Int: 5, Dur(s): 1.0, Mode: GET, Ops: 409, MB/s: 1636.00, IO/s: 409, Lat(ms): [ min: 10.6, avg: 18. 
2021/11/09 13:00:48 Loop: 0, Int: 6, Dur(s): 1.0, Mode: GET, Ops: 404, MB/s: 1616.00, IO/s: 404, Lat(ms): [ min: 11.0, avg: 18. 
2021/11/09 13:00:49 Loop: 0, Int: 7, Dur(s): 1.0, Mode: GET, Ops: 410, MB/s: 1640.00, IO/s: 410, Lat(ms): [ min: 10.1, avg: 17. 
2021/11/09 13:00:50 Loop: 0, Int: 8, Dur(s): 1.0, Mode: GET, Ops: 409, MB/s: 1636.00, IO/s: 409, Lat(ms): [ min: 10.6, avg: 18. 
2021/11/09 13:00:51 Loop: 0, Int: 9, Dur(s): 1.0, Mode: GET, Ops: 413, MB/s: 1652.00, IO/s: 413, Lat(ms): [ min: 10.9, avg: 17. 
2021/11/09 13:00:52 Loop: 0, Int: 10, Dur(s): 1.0, Mode: GET, Ops: 395, MB/s: 1580.00, IO/s: 395, Lat(ms): [ min: 10.5, avg: 18 
2021/11/09 13:00:53 Loop: 0, Int: 11, Dur(s): 1.0, Mode: GET, Ops: 413, MB/s: 1652.00, IO/s: 413, Lat(ms): [ min: 8.8, avg: 17. 
2021/11/09 13:00:53 Loop: 0, Int: TOTAL, Dur(s): 12.4, Mode: GET, Ops: 5000, MB/s: 1606.91, IO/s: 402, Lat(ms): [ min: 8.8, avg 
❯ numactl -N 1 -m 1 -- ~/go/bin/hsbench -a b2345678901234567890 -s b234567890123456789012345678901234567890 -u http://127.0.0.1:8000 -z 4M -d -1 -t 8 -b 8 -n 5000 -m g -bp b01b |& tee hsbench.log | stdbuf -oL -eL colrm 128 | ccze -Aonolookups
2021/11/09 13:01:40 Hotsauce S3 Benchmark Version 0.1 
2021/11/09 13:01:40 Parameters: 
2021/11/09 13:01:40 url=http://127.0.0.1:8000 
2021/11/09 13:01:40 object_prefix= 
2021/11/09 13:01:40 bucket_prefix=b01b 
2021/11/09 13:01:40 region=us-east-1 
2021/11/09 13:01:40 modes=g 
2021/11/09 13:01:40 output= 
2021/11/09 13:01:40 json_output= 
2021/11/09 13:01:40 max_keys=1000 
2021/11/09 13:01:40 object_count=5000 
2021/11/09 13:01:40 bucket_count=8 
2021/11/09 13:01:40 duration=-1 
2021/11/09 13:01:40 threads=8 
2021/11/09 13:01:40 loops=1 
2021/11/09 13:01:40 size=4M 
2021/11/09 13:01:40 interval=1.000000 
2021/11/09 13:01:40 Running Loop 0 OBJECT GET TEST 
2021/11/09 13:01:41 Loop: 0, Int: 0, Dur(s): 1.0, Mode: GET, Ops: 398, MB/s: 1592.00, IO/s: 398, Lat(ms): [ min: 10.0, avg: 18. 
2021/11/09 13:01:42 Loop: 0, Int: 1, Dur(s): 1.0, Mode: GET, Ops: 403, MB/s: 1612.00, IO/s: 403, Lat(ms): [ min: 11.1, avg: 18. 
2021/11/09 13:01:43 Loop: 0, Int: 2, Dur(s): 1.0, Mode: GET, Ops: 418, MB/s: 1672.00, IO/s: 418, Lat(ms): [ min: 10.4, avg: 17. 
2021/11/09 13:01:44 Loop: 0, Int: 3, Dur(s): 1.0, Mode: GET, Ops: 412, MB/s: 1648.00, IO/s: 412, Lat(ms): [ min: 10.8, avg: 17. 
2021/11/09 13:01:45 Loop: 0, Int: 4, Dur(s): 1.0, Mode: GET, Ops: 406, MB/s: 1624.00, IO/s: 406, Lat(ms): [ min: 11.5, avg: 18. 
2021/11/09 13:01:46 Loop: 0, Int: 5, Dur(s): 1.0, Mode: GET, Ops: 401, MB/s: 1604.00, IO/s: 401, Lat(ms): [ min: 11.1, avg: 18. 
2021/11/09 13:01:47 Loop: 0, Int: 6, Dur(s): 1.0, Mode: GET, Ops: 414, MB/s: 1656.00, IO/s: 414, Lat(ms): [ min: 10.2, avg: 17. 
2021/11/09 13:01:48 Loop: 0, Int: 7, Dur(s): 1.0, Mode: GET, Ops: 411, MB/s: 1644.00, IO/s: 411, Lat(ms): [ min: 10.6, avg: 17. 
2021/11/09 13:01:49 Loop: 0, Int: 8, Dur(s): 1.0, Mode: GET, Ops: 406, MB/s: 1624.00, IO/s: 406, Lat(ms): [ min: 10.7, avg: 18. 
2021/11/09 13:01:50 Loop: 0, Int: 9, Dur(s): 1.0, Mode: GET, Ops: 413, MB/s: 1652.00, IO/s: 413, Lat(ms): [ min: 9.4, avg: 17.6 
2021/11/09 13:01:51 Loop: 0, Int: 10, Dur(s): 1.0, Mode: GET, Ops: 426, MB/s: 1704.00, IO/s: 426, Lat(ms): [ min: 10.6, avg: 17 
2021/11/09 13:01:52 Loop: 0, Int: 11, Dur(s): 1.0, Mode: GET, Ops: 403, MB/s: 1612.00, IO/s: 403, Lat(ms): [ min: 11.0, avg: 18 
2021/11/09 13:01:52 Loop: 0, Int: TOTAL, Dur(s): 12.2, Mode: GET, Ops: 5000, MB/s: 1638.54, IO/s: 410, Lat(ms): [ min: 9.4, avg 

@mkogan1

mkogan1 commented Nov 9, 2021

Copy link
Copy Markdown
Contributor

adding comparison between request_timeout_ms=0 and request_timeout_ms=65000 while without 0f539b7

image

full hsbench logs in chronological order from left to right:

❯ numactl -N 1 -m 1 -- ~/go/bin/hsbench -a b2345678901234567890 -s b234567890123456789012345678901234567890 -u http://127.0.0.1:8000 -z 4M -d -1 -t 8 -b 8 -n 5000 -m g -bp b01b |& tee hsbench.log | stdbuf -oL -eL colrm 128 | ccze -Aonolookups
2021/11/09 13:28:49 Hotsauce S3 Benchmark Version 0.1 
2021/11/09 13:28:49 Parameters: 
2021/11/09 13:28:49 url=http://127.0.0.1:8000 
2021/11/09 13:28:49 object_prefix= 
2021/11/09 13:28:49 bucket_prefix=b01b 
2021/11/09 13:28:49 region=us-east-1 
2021/11/09 13:28:49 modes=g 
2021/11/09 13:28:49 output= 
2021/11/09 13:28:49 json_output= 
2021/11/09 13:28:49 max_keys=1000 
2021/11/09 13:28:49 object_count=5000 
2021/11/09 13:28:49 bucket_count=8 
2021/11/09 13:28:49 duration=-1 
2021/11/09 13:28:49 threads=8 
2021/11/09 13:28:49 loops=1 
2021/11/09 13:28:49 size=4M 
2021/11/09 13:28:49 interval=1.000000 
2021/11/09 13:28:49 Running Loop 0 OBJECT GET TEST 
2021/11/09 13:28:50 Loop: 0, Int: 0, Dur(s): 1.0, Mode: GET, Ops: 437, MB/s: 1748.00, IO/s: 437, Lat(ms): [ min: 8.6, avg: 16.6 
2021/11/09 13:28:51 Loop: 0, Int: 1, Dur(s): 1.0, Mode: GET, Ops: 420, MB/s: 1680.00, IO/s: 420, Lat(ms): [ min: 9.3, avg: 17.5 
2021/11/09 13:28:52 Loop: 0, Int: 2, Dur(s): 1.0, Mode: GET, Ops: 424, MB/s: 1696.00, IO/s: 424, Lat(ms): [ min: 9.6, avg: 17.2 
2021/11/09 13:28:53 Loop: 0, Int: 3, Dur(s): 1.0, Mode: GET, Ops: 430, MB/s: 1720.00, IO/s: 430, Lat(ms): [ min: 9.7, avg: 17.0 
2021/11/09 13:28:54 Loop: 0, Int: 4, Dur(s): 1.0, Mode: GET, Ops: 419, MB/s: 1676.00, IO/s: 419, Lat(ms): [ min: 10.2, avg: 17. 
2021/11/09 13:28:55 Loop: 0, Int: 5, Dur(s): 1.0, Mode: GET, Ops: 412, MB/s: 1648.00, IO/s: 412, Lat(ms): [ min: 9.2, avg: 17.8 
2021/11/09 13:28:56 Loop: 0, Int: 6, Dur(s): 1.0, Mode: GET, Ops: 415, MB/s: 1660.00, IO/s: 415, Lat(ms): [ min: 10.1, avg: 17. 
2021/11/09 13:28:57 Loop: 0, Int: 7, Dur(s): 1.0, Mode: GET, Ops: 427, MB/s: 1708.00, IO/s: 427, Lat(ms): [ min: 9.9, avg: 17.1 
2021/11/09 13:28:58 Loop: 0, Int: 8, Dur(s): 1.0, Mode: GET, Ops: 417, MB/s: 1668.00, IO/s: 417, Lat(ms): [ min: 10.0, avg: 17. 
2021/11/09 13:28:59 Loop: 0, Int: 9, Dur(s): 1.0, Mode: GET, Ops: 419, MB/s: 1676.00, IO/s: 419, Lat(ms): [ min: 9.7, avg: 17.6 
2021/11/09 13:29:00 Loop: 0, Int: 10, Dur(s): 1.0, Mode: GET, Ops: 424, MB/s: 1696.00, IO/s: 424, Lat(ms): [ min: 9.6, avg: 17. 
2021/11/09 13:29:01 Loop: 0, Int: TOTAL, Dur(s): 11.9, Mode: GET, Ops: 5000, MB/s: 1684.85, IO/s: 421, Lat(ms): [ min: 8.6, avg 
❯ numactl -N 1 -m 1 -- ~/go/bin/hsbench -a b2345678901234567890 -s b234567890123456789012345678901234567890 -u http://127.0.0.1:8000 -z 4M -d -1 -t 8 -b 8 -n 5000 -m g -bp b01b |& tee hsbench.log | stdbuf -oL -eL colrm 128 | ccze -Aonolookups
2021/11/09 13:29:28 Hotsauce S3 Benchmark Version 0.1 
2021/11/09 13:29:28 Parameters: 
2021/11/09 13:29:28 url=http://127.0.0.1:8000 
2021/11/09 13:29:28 object_prefix= 
2021/11/09 13:29:28 bucket_prefix=b01b 
2021/11/09 13:29:28 region=us-east-1 
2021/11/09 13:29:28 modes=g 
2021/11/09 13:29:28 output= 
2021/11/09 13:29:28 json_output= 
2021/11/09 13:29:28 max_keys=1000 
2021/11/09 13:29:28 object_count=5000 
2021/11/09 13:29:28 bucket_count=8 
2021/11/09 13:29:28 duration=-1 
2021/11/09 13:29:28 threads=8 
2021/11/09 13:29:28 loops=1 
2021/11/09 13:29:28 size=4M 
2021/11/09 13:29:28 interval=1.000000 
2021/11/09 13:29:28 Running Loop 0 OBJECT GET TEST 
2021/11/09 13:29:29 Loop: 0, Int: 0, Dur(s): 1.0, Mode: GET, Ops: 398, MB/s: 1592.00, IO/s: 398, Lat(ms): [ min: 9.7, avg: 18.2 
2021/11/09 13:29:30 Loop: 0, Int: 1, Dur(s): 1.0, Mode: GET, Ops: 412, MB/s: 1648.00, IO/s: 412, Lat(ms): [ min: 10.2, avg: 17. 
2021/11/09 13:29:31 Loop: 0, Int: 2, Dur(s): 1.0, Mode: GET, Ops: 409, MB/s: 1636.00, IO/s: 409, Lat(ms): [ min: 9.5, avg: 18.0 
2021/11/09 13:29:32 Loop: 0, Int: 3, Dur(s): 1.0, Mode: GET, Ops: 412, MB/s: 1648.00, IO/s: 412, Lat(ms): [ min: 10.7, avg: 17. 
2021/11/09 13:29:33 Loop: 0, Int: 4, Dur(s): 1.0, Mode: GET, Ops: 405, MB/s: 1620.00, IO/s: 405, Lat(ms): [ min: 11.2, avg: 18. 
2021/11/09 13:29:34 Loop: 0, Int: 5, Dur(s): 1.0, Mode: GET, Ops: 411, MB/s: 1644.00, IO/s: 411, Lat(ms): [ min: 10.1, avg: 17. 
2021/11/09 13:29:35 Loop: 0, Int: 6, Dur(s): 1.0, Mode: GET, Ops: 421, MB/s: 1684.00, IO/s: 421, Lat(ms): [ min: 10.2, avg: 17. 
2021/11/09 13:29:36 Loop: 0, Int: 7, Dur(s): 1.0, Mode: GET, Ops: 421, MB/s: 1684.00, IO/s: 421, Lat(ms): [ min: 10.2, avg: 17. 
2021/11/09 13:29:37 Loop: 0, Int: 8, Dur(s): 1.0, Mode: GET, Ops: 406, MB/s: 1624.00, IO/s: 406, Lat(ms): [ min: 10.7, avg: 18. 
2021/11/09 13:29:38 Loop: 0, Int: 9, Dur(s): 1.0, Mode: GET, Ops: 408, MB/s: 1632.00, IO/s: 408, Lat(ms): [ min: 10.3, avg: 17. 
2021/11/09 13:29:39 Loop: 0, Int: 10, Dur(s): 1.0, Mode: GET, Ops: 421, MB/s: 1684.00, IO/s: 421, Lat(ms): [ min: 10.1, avg: 17 
2021/11/09 13:29:40 Loop: 0, Int: 11, Dur(s): 1.0, Mode: GET, Ops: 407, MB/s: 1628.00, IO/s: 407, Lat(ms): [ min: 10.6, avg: 17 
2021/11/09 13:29:41 Loop: 0, Int: TOTAL, Dur(s): 12.2, Mode: GET, Ops: 5000, MB/s: 1644.96, IO/s: 411, Lat(ms): [ min: 9.5, avg 

@mkogan1

mkogan1 commented Nov 9, 2021

Copy link
Copy Markdown
Contributor

aggregating results from previous runs - without commit 0f539b7 the IO/s performance is slightly lower (and correspondingly the CPU usage is slightly lower also)

+-----------------+--------------------------+----------------------+
|      IO/s       | request_timeout_ms=65000 | request_timeout_ms=0 |
+-----------------+--------------------------+----------------------+
| with 0f539b7    | 413                      | 427                  |
+-----------------+--------------------------+----------------------+
| without 0f539b7 | 411                      | 421                  |
+-----------------+--------------------------+----------------------+

@cbodley

cbodley commented Nov 9, 2021

Copy link
Copy Markdown
Contributor Author

thanks @mkogan1, that helps a lot. looking at the request_timeout_ms=0 case, we wouldn't be hitting the allocator at all, so i assume the difference between 427 and 421 is probably just noise. the comparison at 65000 is even smaller, so it doesn't look like the custom allocator is giving us a significant benefit

what do you think Mark?

@mkogan1

mkogan1 commented Nov 9, 2021 •

Copy link
Copy Markdown
Contributor

thanks @mkogan1, that helps a lot. looking at the request_timeout_ms=0 case, we wouldn't be hitting the allocator at all, so i assume the difference between 427 and 421 is probably just noise. the comparison at 65000 is even smaller, so it doesn't look like the custom allocator is giving us a significant benefit

what do you think Mark?

@cbodley yes, agree that the custom allocator is not showing a significant performance benefit
(the 421&427 IO/s is pretty much the top result from multiple runs, there are fluctuations of up to about 6 IO/s down)

@cbodley
cbodley force-pushed the wip-beast-timeout-alloc branch from 64d5894 to f43e6ae Compare November 9, 2021 15:12
@cbodley
cbodley marked this pull request as ready for review November 9, 2021 15:13
@cbodley

cbodley commented Nov 9, 2021

Copy link
Copy Markdown
Contributor Author

ok, i removed the final 2 commits related to the custom allocator. this is ready for qa

@ofriedma

ofriedma commented Nov 9, 2021

Copy link
Copy Markdown
Contributor

@cbodley I think there are some unrelated commits in the PR

@cbodley
cbodley force-pushed the wip-beast-timeout-alloc branch from f43e6ae to fc9d30b Compare November 9, 2021 15:54
@mkogan1

mkogan1 commented Nov 9, 2021

Copy link
Copy Markdown
Contributor

test results after git rest --hard wip-beast-timeout-alloc following the force push :
left: request_timeout_ms=65000 , right: request_timeout_ms=0
image

@cbodley

cbodley commented Nov 10, 2021

Copy link
Copy Markdown
Contributor Author

i'm seeing a few crashes in teuthology:

terminate called after throwing an instance of 'boost::wrapexcept<boost::system::system_error>'
  what():  close: Bad file descriptor

i assume it's coming from timeout_handler's call to stream->close() after the stream is already closed. this should be calling the non-throwing close(error_code &) overload and ignoring its error code instead. but if the socket is already closed, then it may have also gone out of scope. so my main concern is that we're missing a call to timeout.cancel() in one of the code paths that arms the timeout

@cbodley

cbodley commented Nov 10, 2021

Copy link
Copy Markdown
Contributor Author

even with that fix to close(), valgrind does still complain that timeout_handler is accessing the stream after destruction:

  <what>Invalid read of size 8</what>
  <stack>
    <frame>
      <ip>0x52F581C</ip>
      <obj>/usr/lib64/libradosgw.so.2.0.0</obj>
      <fn>boost::asio::detail::reactive_socket_service_base::close(boost::asio::detail::reactive_socket_service_base::base_implementation_type&amp;, boost::system::error_code&amp;)</fn>
    </frame>
    <frame>
      <ip>0x52FF7BF</ip>
      <obj>/usr/lib64/libradosgw.so.2.0.0</obj>
      <fn>boost::asio::detail::wait_handler&lt;rgw::timeout_handler&lt;boost::asio::basic_socket&lt;boost::asio::ip::tcp, boost::asio::io_context::basic_executor_type&lt;std::allocator&lt;void&gt;, 0u&gt; &gt; &gt;, boost::asio::io_context::basic_executor_type&lt;std::allocator&lt;void&gt;, 0u&gt; &gt;::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&amp;, unsigned long)</fn>
    </frame>

the #ifdef was covering more includes than it should have

Signed-off-by: Casey Bodley <[email protected]>
the default spawn::yield_context uses the polymorphic boost::asio::executor
to support any executor type

rgw's beast frontend always uses the same executor type for these
coroutines, so we can use that type directly to avoid the overhead of
type erasure and virtual function calls

Signed-off-by: Casey Bodley <[email protected]>
remove the beast::tcp_stream wrapper from the socket, and track timeouts
manually with a timeout_timer. this timer uses ceph's coarse_mono_clock
which is cheaper to sample than std::chrono::steady_clock

Signed-off-by: Casey Bodley <[email protected]>
resolves a use-after-free in the timeout_handler, where a timeout fires
and schedules the timeout_handler for execution, but the coroutine exits
and destroys the socket before asio executes the timeout_handler

timeout_handler now holds a reference on the Connection to extend its
lifetime

now that the Connection is allocated on the heap, we can include the
parse_buffer in this memory instead of allocating it separately

Signed-off-by: Casey Bodley <[email protected]>
@cbodley
cbodley force-pushed the wip-beast-timeout-alloc branch from 240cd06 to a68fbb1 Compare November 12, 2021 14:54
@cbodley

cbodley commented Nov 12, 2021

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Nov 12, 2021

Copy link
Copy Markdown
Contributor Author

jenkins test make check

fixes all S3 operations failing with:
`2021-11-15T15:46:05.992+0000 7ffee17fa700 20 failed to read header: Bad file descriptor`
when `--rgw_frontends="beast port=8000 request_timeout_ms=0"`

Signed-off-by: Mark Kogan <[email protected]>
@mkogan1

mkogan1 commented Nov 15, 2021

Copy link
Copy Markdown
Contributor

results after latest re-push + the request_timeout_ms=0 disabling timers commit
left side request_timeout_ms=65000 , right side request_timeout_ms=0
cpu usage look good
image

@cbodley

cbodley commented Nov 15, 2021

Copy link
Copy Markdown
Contributor Author

thanks for the fix @mkogan1, the commit looks good 👍

are you satisfied with the results here? is there anything you'd change before merging?

@mkogan1

mkogan1 commented Nov 15, 2021

Copy link
Copy Markdown
Contributor

thanks for the fix @mkogan1, the commit looks good +1

are you satisfied with the results here? is there anything you'd change before merging?

@cbodley yes, just re-checked vs master and satisfied with the results, lgtm to merge

@cbodley

cbodley commented Nov 15, 2021

Copy link
Copy Markdown
Contributor Author

jenkins test make check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants