Skip to content

Commit 8eae3c0

Browse files
authored
Merge branch 'fluent:master' into dietWall/fix_machine_id_in_docker
2 parents 53141bf + 4f8c50b commit 8eae3c0

File tree

9 files changed

+113
-12
lines changed

9 files changed

+113
-12
lines changed

.github/workflows/staging-release.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,9 +842,20 @@ jobs:
842842
tag_name: v${{ inputs.version }}
843843
make_latest: false
844844

845-
- name: Release 4.1 and latest
845+
- name: Release 4.1 - not latest
846846
uses: softprops/action-gh-release@v2
847847
if: startsWith(inputs.version, '4.1')
848+
with:
849+
body: "https://fluentbit.io/announcements/v${{ inputs.version }}/"
850+
draft: false
851+
generate_release_notes: true
852+
name: "Fluent Bit ${{ inputs.version }}"
853+
tag_name: v${{ inputs.version }}
854+
make_latest: false
855+
856+
- name: Release 4.2 and latest
857+
uses: softprops/action-gh-release@v2
858+
if: startsWith(inputs.version, '4.2')
848859
with:
849860
body: "https://fluentbit.io/announcements/v${{ inputs.version }}/"
850861
draft: false
@@ -969,13 +980,20 @@ jobs:
969980
token: ${{ secrets.GH_PA_TOKEN }}
970981
ref: '4.0'
971982

972-
- name: Release 4.1 and latest
983+
- name: Release 4.1 - not latest
973984
if: startsWith(inputs.version, '4.1')
974985
uses: actions/checkout@v5
975986
with:
976987
repository: fluent/fluent-bit-docs
977988
token: ${{ secrets.GH_PA_TOKEN }}
978989

990+
- name: Release 4.2 and latest
991+
if: startsWith(inputs.version, '4.2')
992+
uses: actions/checkout@v5
993+
with:
994+
repository: fluent/fluent-bit-docs
995+
token: ${{ secrets.GH_PA_TOKEN }}
996+
979997
- name: Ensure we have the script we need
980998
run: |
981999
if [[ ! -f update-release-version-docs.sh ]] ; then
@@ -1076,6 +1094,12 @@ jobs:
10761094
- name: Release 4.1
10771095
if: startsWith(inputs.version, '4.1')
10781096
uses: actions/checkout@v5
1097+
with:
1098+
ref: 4.1
1099+
1100+
- name: Release 4.2
1101+
if: startsWith(inputs.version, '4.2')
1102+
uses: actions/checkout@v5
10791103
with:
10801104
ref: master
10811105

.github/workflows/unit-tests.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,23 @@ jobs:
8080
permissions:
8181
contents: read
8282
steps:
83+
- name: Free disk space
84+
run: |
85+
echo "::group::Disk usage before cleanup"
86+
df -h
87+
echo "::endgroup::"
88+
89+
sudo rm -rf /usr/share/dotnet || true
90+
sudo rm -rf /usr/local/lib/android || true
91+
sudo rm -rf /opt/ghc || true
92+
sudo rm -rf /usr/lib/jvm || true
93+
94+
sudo apt-get clean || true
95+
96+
echo "::group::Disk usage after cleanup"
97+
df -h
98+
echo "::endgroup::"
99+
83100
- name: Setup environment
84101
run: |
85102
sudo apt-get update

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
88
# Fluent Bit Version
99
set(FLB_VERSION_MAJOR 4)
1010
set(FLB_VERSION_MINOR 2)
11-
set(FLB_VERSION_PATCH 0)
11+
set(FLB_VERSION_PATCH 1)
1212
set(FLB_VERSION_STR "${FLB_VERSION_MAJOR}.${FLB_VERSION_MINOR}.${FLB_VERSION_PATCH}")
1313

1414
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

dockerfiles/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7,linux/s390x" -f ./dockerfiles/Dockerfile.multiarch --build-arg FLB_TARBALL=https://github.com/fluent/fluent-bit/archive/v1.8.11.tar.gz ./dockerfiles/
1414

1515
# Set this to the current release version: it gets done so as part of the release.
16-
ARG RELEASE_VERSION=4.1.2
16+
ARG RELEASE_VERSION=4.2.1
1717

1818
# For multi-arch builds - assumption is running on an AMD64 host
1919
FROM multiarch/qemu-user-static:x86_64-arm AS qemu-arm32

fluent-bit-4.2.0.bb renamed to fluent-bit-4.2.1.bb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
1616
SECTION = "net"
1717

1818
PR = "r0"
19-
PV = "4.2.0"
19+
PV = "4.2.1"
2020

2121
SRCREV = "v${PV}"
2222
SRC_URI = "git://github.com/fluent/fluent-bit.git;nobranch=1"

plugins/in_forward/fw.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,28 +124,37 @@ static int fw_unix_create(struct flb_in_fw_config *ctx)
124124
static int in_fw_collect(struct flb_input_instance *ins,
125125
struct flb_config *config, void *in_context)
126126
{
127+
int state_backup;
127128
struct flb_connection *connection;
128129
struct fw_conn *conn;
129130
struct flb_in_fw_config *ctx;
130131

131132
ctx = in_context;
132133

134+
state_backup = ctx->state;
135+
ctx->state = FW_INSTANCE_STATE_ACCEPTING_CLIENT;
136+
133137
connection = flb_downstream_conn_get(ctx->downstream);
134138

135139
if (connection == NULL) {
136140
flb_plg_error(ctx->ins, "could not accept new connection");
141+
ctx->state = state_backup;
137142

138143
return -1;
139144
}
140145

141146
if (!config->is_ingestion_active) {
142147
flb_downstream_conn_release(connection);
148+
ctx->state = state_backup;
149+
143150
return -1;
144151
}
145152

146153
if(ctx->is_paused) {
147154
flb_downstream_conn_release(connection);
148155
flb_plg_trace(ins, "TCP connection will be closed FD=%i", connection->fd);
156+
ctx->state = state_backup;
157+
149158
return -1;
150159
}
151160

@@ -154,9 +163,17 @@ static int in_fw_collect(struct flb_input_instance *ins,
154163
conn = fw_conn_add(connection, ctx);
155164
if (!conn) {
156165
flb_downstream_conn_release(connection);
166+
ctx->state = state_backup;
167+
157168
return -1;
158169
}
159170

171+
ctx->state = state_backup;
172+
173+
if (ctx->state == FW_INSTANCE_STATE_PAUSED) {
174+
fw_conn_del_all(ctx);
175+
}
176+
160177
return 0;
161178
}
162179

@@ -263,6 +280,7 @@ static int in_fw_init(struct flb_input_instance *ins,
263280
return -1;
264281
}
265282

283+
ctx->state = FW_INSTANCE_STATE_RUNNING;
266284
ctx->coll_fd = -1;
267285
ctx->ins = ins;
268286
mk_list_init(&ctx->connections);
@@ -386,7 +404,10 @@ static void in_fw_pause(void *data, struct flb_config *config)
386404
return;
387405
}
388406

389-
fw_conn_del_all(ctx);
407+
if (ctx->state == FW_INSTANCE_STATE_RUNNING) {
408+
fw_conn_del_all(ctx);
409+
}
410+
390411
ctx->is_paused = FLB_TRUE;
391412
ret = pthread_mutex_unlock(&ctx->conn_mutex);
392413
if (ret != 0) {
@@ -406,6 +427,8 @@ static void in_fw_pause(void *data, struct flb_config *config)
406427
if (config->is_ingestion_active == FLB_FALSE) {
407428
fw_conn_del_all(ctx);
408429
}
430+
431+
ctx->state = FW_INSTANCE_STATE_PAUSED;
409432
}
410433

411434
static void in_fw_resume(void *data, struct flb_config *config) {
@@ -427,6 +450,8 @@ static void in_fw_resume(void *data, struct flb_config *config) {
427450
flb_plg_error(ctx->ins, "cannot unlock collector mutex");
428451
return;
429452
}
453+
454+
ctx->state = FW_INSTANCE_STATE_RUNNING;
430455
}
431456
}
432457

plugins/in_forward/fw.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
#include <fluent-bit/flb_log_event_decoder.h>
2626
#include <fluent-bit/flb_log_event_encoder.h>
2727

28+
#define FW_INSTANCE_STATE_RUNNING 0
29+
#define FW_INSTANCE_STATE_ACCEPTING_CLIENT 1
30+
#define FW_INSTANCE_STATE_PROCESSING_PACKET 2
31+
#define FW_INSTANCE_STATE_PAUSED 3
32+
33+
2834
enum {
2935
FW_HANDSHAKE_HELO = 1,
3036
FW_HANDSHAKE_PINGPONG = 2,
@@ -76,6 +82,8 @@ struct flb_in_fw_config {
7682

7783
pthread_mutex_t conn_mutex;
7884

85+
int state;
86+
7987
/* Plugin is paused */
8088
int is_paused;
8189
};

plugins/in_forward/fw_conn.c

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
#include "fw_prot.h"
2929
#include "fw_conn.h"
3030

31-
/* Callback invoked every time an event is triggered for a connection */
32-
int fw_conn_event(void *data)
31+
static int fw_conn_event_internal(struct flb_connection *connection)
3332
{
3433
int ret;
3534
int bytes;
@@ -39,9 +38,6 @@ int fw_conn_event(void *data)
3938
struct fw_conn *conn;
4039
struct mk_event *event;
4140
struct flb_in_fw_config *ctx;
42-
struct flb_connection *connection;
43-
44-
connection = (struct flb_connection *) data;
4541

4642
conn = connection->user_data;
4743

@@ -127,6 +123,37 @@ int fw_conn_event(void *data)
127123
return 0;
128124
}
129125

126+
/* Callback invoked every time an event is triggered for a connection */
127+
int fw_conn_event(void *data)
128+
{
129+
struct flb_in_fw_config *ctx;
130+
struct fw_conn *conn;
131+
int result;
132+
struct flb_connection *connection;
133+
int state_backup;
134+
135+
connection = (struct flb_connection *) data;
136+
137+
conn = connection->user_data;
138+
139+
ctx = conn->ctx;
140+
141+
state_backup = ctx->state;
142+
143+
ctx->state = FW_INSTANCE_STATE_PROCESSING_PACKET;
144+
145+
result = fw_conn_event_internal(connection);
146+
147+
if (ctx->state == FW_INSTANCE_STATE_PROCESSING_PACKET) {
148+
ctx->state = state_backup;
149+
}
150+
else if (ctx->state == FW_INSTANCE_STATE_PAUSED) {
151+
fw_conn_del_all(ctx);
152+
}
153+
154+
return result;
155+
}
156+
130157
/* Create a new Forward request instance */
131158
struct fw_conn *fw_conn_add(struct flb_connection *connection, struct flb_in_fw_config *ctx)
132159
{

snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: fluent-bit
22
base: core20
3-
version: '4.2.0'
3+
version: '4.2.1'
44
summary: High performance logs and stream processor
55
description: |
66
Fluent Bit is a high performance log processor and stream processor for Linux.

0 commit comments

Comments
 (0)