Skip to content

Commit 1e8d2c4

Browse files
committed
FDS output: update dependency of collector version, improve handling of exceptions during a message process
1 parent 9b23fd8 commit 1e8d2c4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/plugins/output/fds/src/fds.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ IPX_API struct ipx_plugin_info ipx_plugin_info = {
3030
// Plugin version string (like "1.2.3")
3131
"2.0.0",
3232
// Minimal IPFIXcol version string (like "1.2.3")
33-
"2.0.0"
33+
"2.1.0"
3434
};
3535

3636
/// Instance
@@ -106,6 +106,7 @@ int
106106
ipx_plugin_process(ipx_ctx_t *ctx, void *cfg, ipx_msg_t *msg)
107107
{
108108
auto *inst = reinterpret_cast<Instance *>(cfg);
109+
bool failed = false;
109110

110111
try {
111112
// Check if the current time window should be closed
@@ -114,12 +115,19 @@ ipx_plugin_process(ipx_ctx_t *ctx, void *cfg, ipx_msg_t *msg)
114115
inst->storage_ptr->process_msg(msg_ipfix);
115116
} catch (const FDS_exception &ex) {
116117
IPX_CTX_ERROR(ctx, "%s", ex.what());
117-
inst->storage_ptr->window_close();
118+
failed = true;
118119
} catch (std::exception &ex) {
119120
IPX_CTX_ERROR(ctx, "Unexpected error has occurred: %s", ex.what());
120-
inst->storage_ptr->window_close();
121+
failed = true;
121122
} catch (...) {
122123
IPX_CTX_ERROR(ctx, "Unknown error has occurred!");
124+
failed = true;
125+
}
126+
127+
if (failed) {
128+
IPX_CTX_ERROR(ctx, "Due to the previous error(s), the output file is possibly corrupted. "
129+
"Therefore, no flow records are stored until a new file is automatically opened "
130+
"after current window expiration.");
123131
inst->storage_ptr->window_close();
124132
}
125133

0 commit comments

Comments
 (0)