Skip to content

Commit 973c645

Browse files
authored
Merge branch 'open-telemetry:main' into feature/statsd_exporter
2 parents 16829fd + 6392b5f commit 973c645

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

exporters/fluentd/include/opentelemetry/exporters/fluentd/common/socket_tools.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,14 @@ struct Socket {
585585
assert(m_sock != Invalid);
586586
if ((m_sock == Invalid) || (buffer == nullptr) || (size == 0))
587587
return 0;
588+
int flags =
589+
#ifdef _WIN32
590+
0;
591+
#else
592+
MSG_NOSIGNAL;
593+
#endif
588594
return static_cast<int>(
589-
::send(m_sock, reinterpret_cast<char const *>(buffer), size, 0));
595+
::send(m_sock, reinterpret_cast<char const *>(buffer), size, flags));
590596
}
591597

592598
int sendto(void const *buffer, size_t size, int flags, SocketAddr &destAddr) {

exporters/geneva/include/opentelemetry/exporters/geneva/metrics/socket_tools.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,14 @@ struct Socket {
570570
assert(m_sock != Invalid);
571571
if ((m_sock == Invalid) || (buffer == nullptr) || (size == 0))
572572
return 0;
573+
int flags =
574+
#ifdef _WIN32
575+
0;
576+
#else
577+
MSG_NOSIGNAL;
578+
#endif
573579
return static_cast<int>(
574-
::send(m_sock, reinterpret_cast<char const *>(buffer), size, 0));
580+
::send(m_sock, reinterpret_cast<char const *>(buffer), size, flags));
575581
}
576582

577583
int sendto(void const *buffer, size_t size, int flags, SocketAddr &destAddr) {

exporters/geneva/src/exporter.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ Exporter::Exporter(const ExporterOptions &options)
4242
auto status = data_transport_->Connect();
4343
if (!status) {
4444
LOG_ERROR("[Geneva Exporter] Connect failed. No data would be sent.");
45-
is_shutdown_ = true;
4645
return;
4746
}
4847
}

exporters/geneva/src/socket_data_transport.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ bool SocketDataTransport::Send(MetricsEventType event_type,
5858
"Geneva Exporter: UDS::Send Socket reconnect failed. Send failed");
5959
}
6060
}
61-
if (error_code != 0) {
61+
if (!connected_ || error_code != 0 ) {
6262
LOG_ERROR("Geneva Exporter: UDS::Send failed - not connected");
6363
connected_ = false;
6464
return false;
@@ -77,7 +77,7 @@ bool SocketDataTransport::Send(MetricsEventType event_type,
7777
bool SocketDataTransport::Disconnect() noexcept {
7878
if (connected_) {
7979
connected_ = false;
80-
if (socket_.invalid()) {
80+
if (!socket_.invalid()) {
8181
socket_.close();
8282
return true;
8383
}

0 commit comments

Comments
 (0)