Skip to content

Commit

Permalink
Merge pull request redpanda-data#17841 from dotnwat/rpc-new-style
Browse files Browse the repository at this point in the history
CORE-2347: net: remove dependence on rpc parsing exception type
  • Loading branch information
dotnwat authored Apr 13, 2024
2 parents 9fe664f + 42f826c commit 14e99dc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmake/FindLZ4.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(LZ4_INCLUDE_DIR AND EXISTS "${LZ4_INCLUDE_DIR}/lz4.h")
"${LZ4_VERSION_MAJOR}.${LZ4_VERSION_MINOR}.${LZ4_VERSION_RELEASE}")
endif()

find_library(LZ4_LIBRARY NAMES lz4)
find_library(LZ4_LIBRARY NAMES liblz4.a)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LZ4
Expand Down
4 changes: 2 additions & 2 deletions src/v/net/connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "base/seastarx.h"
#include "net/exceptions.h"
#include "rpc/service.h"
#include "net/types.h"
#include "ssx/abort_source.h"

#include <seastar/core/future.hh>
Expand Down Expand Up @@ -85,7 +85,7 @@ std::optional<ss::sstring> is_disconnect_exception(std::exception_ptr e) {
// Happens on unclean client disconnect, when io_iterator_consumer
// gets fewer bytes than it wanted
return "short read";
} catch (const rpc::rpc_internal_body_parsing_exception&) {
} catch (const net::parsing_exception&) {
// Happens on unclean client disconnect, typically wrapping
// an out_of_range
return "parse error";
Expand Down
2 changes: 2 additions & 0 deletions src/v/net/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ class authentication_exception : public std::runtime_error {
: std::runtime_error(m) {}
};

class parsing_exception : public std::exception {};

} // namespace net
3 changes: 2 additions & 1 deletion src/v/rpc/service.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#pragma once

#include "base/seastarx.h"
#include "net/types.h"
#include "reflection/async_adl.h"
#include "rpc/parse_utils.h"
#include "rpc/types.h"
Expand Down Expand Up @@ -39,7 +40,7 @@ struct service {
virtual void setup_metrics() = 0;
};

class rpc_internal_body_parsing_exception : public std::exception {
class rpc_internal_body_parsing_exception : public net::parsing_exception {
public:
explicit rpc_internal_body_parsing_exception(const std::exception_ptr& e)
: _what(
Expand Down

0 comments on commit 14e99dc

Please sign in to comment.