We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 260d733 commit 78e2a71Copy full SHA for 78e2a71
exporters/fluentd/src/log/fluentd_exporter.cc
@@ -169,6 +169,10 @@ bool FluentdExporter::Connect() {
169
connected_ = socket_.connect(*addr_);
170
if (!connected_) {
171
LOG_ERROR("Unable to connect to %s", options_.endpoint.c_str());
172
+ // Close the socket to avoid leaking file descriptors on failure.
173
+ if (!socket_.invalid()) {
174
+ socket_.close();
175
+ }
176
return false;
177
}
178
0 commit comments