1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

fix(messageqcpp): MCOL-5636 same node communication crashes transmiting PP errors to EM b/c error messaging leveraged socket that was a nullptr.

This commit is contained in:
Roman Nozdrin
2024-01-11 16:58:47 +00:00
parent 79ad78f91f
commit 22bbfa7239
12 changed files with 300 additions and 155 deletions

View File

@ -39,8 +39,6 @@
class MessageQTestSuite;
#define EXPORT
namespace messageqcpp
{
class ServerSocket;
@ -54,22 +52,22 @@ class IOSocket
/** ctor
*
*/
EXPORT explicit IOSocket(Socket* socket = 0);
explicit IOSocket(Socket* socket = 0);
/** copy ctor
*
*/
EXPORT IOSocket(const IOSocket& rhs);
IOSocket(const IOSocket& rhs);
/** assign op
*
*/
EXPORT IOSocket& operator=(const IOSocket& rhs);
IOSocket& operator=(const IOSocket& rhs);
/** dtor
*
*/
EXPORT virtual ~IOSocket();
virtual ~IOSocket();
/** read a ByteStream from this socket
*
@ -84,9 +82,9 @@ class IOSocket
* This socket needs to be connected first. Will throw runtime_error on I/O error. Caller should
* call close() method if exception is thrown.
*/
EXPORT virtual void write(const ByteStream& msg, Stats* stats = NULL) const;
EXPORT virtual void write_raw(const ByteStream& msg, Stats* stats = NULL) const;
EXPORT virtual void write(SBS msg, Stats* stats = NULL) const;
virtual void write(const ByteStream& msg, Stats* stats = NULL) const;
virtual void write_raw(const ByteStream& msg, Stats* stats = NULL) const;
virtual void write(SBS msg, Stats* stats = NULL) const;
/** access the sockaddr member
*/
@ -125,29 +123,29 @@ class IOSocket
*
* Install a socket implementation that meets the Socket interface
*/
EXPORT virtual void setSocketImpl(Socket* socket);
virtual void setSocketImpl(Socket* socket);
/** get a string rep of the IOSocket
*
*/
EXPORT virtual const std::string toString() const;
virtual const std::string toString() const;
/** syncProto() forwarder for inherited classes
*
*/
EXPORT virtual void syncProto(bool use)
virtual void syncProto(bool use)
{
fSocket->syncProto(use);
}
EXPORT virtual int getConnectionNum() const;
virtual int getConnectionNum() const;
// Debug
EXPORT void setSockID(uint32_t id)
void setSockID(uint32_t id)
{
sockID = id;
}
EXPORT uint32_t getSockID()
uint32_t getSockID()
{
return sockID;
}
@ -174,7 +172,6 @@ class IOSocket
return fSocket->isSameAddr(ipv4Addr);
}
/** connect() forwarder for inherited classes
*
*/
@ -298,5 +295,3 @@ inline std::ostream& operator<<(std::ostream& os, const IOSocket& rhs)
}
} // namespace messageqcpp
#undef EXPORT