Skip to content

Commit 6f9b009

Browse files
committed
router_condition: Fix unconditional route check in routing
The PR #11055 removed the routes_mask guard, which exposed a design flaw in the previous logic. Unconditional routes were being forced through prepare_logs() first. The proper fix is to allow unconditional routes to short-circuit early, so that chunk_trace routes are wired correctly. With this change, the core_chunk_trace unit test will no longer fail. Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent f879a93 commit 6f9b009

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/flb_router_condition.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ int flb_router_path_should_route(struct flb_event_chunk *chunk,
265265
return FLB_FALSE;
266266
}
267267

268+
if (!path->route) {
269+
return FLB_TRUE;
270+
}
271+
268272
if (chunk && chunk->type == FLB_EVENT_TYPE_LOGS) {
269273
if (!context) {
270274
return FLB_FALSE;
@@ -275,10 +279,6 @@ int flb_router_path_should_route(struct flb_event_chunk *chunk,
275279
}
276280
}
277281

278-
if (!path->route) {
279-
return FLB_TRUE;
280-
}
281-
282282
return flb_route_condition_eval(chunk, context, path->route);
283283
}
284284

0 commit comments

Comments
 (0)