Skip to content

Commit cb71833

Browse files
committed
Fix CI
1 parent c5bdee6 commit cb71833

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/confluent_kafka/src/Consumer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,7 @@ static void Consumer_rebalance_cb (rd_kafka_t *rk, rd_kafka_resp_err_t err,
15751575
if (result)
15761576
Py_DECREF(result);
15771577
else {
1578+
15781579
PyErr_Fetch(&cs->exception_type, &cs->exception_value, &cs->exception_traceback);
15791580
CallState_crash(cs);
15801581
rd_kafka_yield(rk);

src/confluent_kafka/src/Producer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ static void dr_msg_cb (rd_kafka_t *rk, const rd_kafka_message_t *rkm,
163163
if (result)
164164
Py_DECREF(result);
165165
else {
166+
166167
PyErr_Fetch(&cs->exception_type, &cs->exception_value, &cs->exception_traceback);
167168
CallState_crash(cs);
168169
rd_kafka_yield(rk);

tests/test_Producer.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def delivery_cb_that_raises(err, msg):
296296
producer = Producer({
297297
'bootstrap.servers': 'nonexistent-broker:9092', # Will cause delivery failures
298298
'socket.timeout.ms': 100,
299-
'message.timeout.ms': 1000,
299+
'message.timeout.ms': 10, # Very short timeout to trigger delivery failure quickly
300300
'on_delivery': delivery_cb_that_raises
301301
})
302302

@@ -307,12 +307,10 @@ def delivery_cb_that_raises(err, msg):
307307
# Before fix: Would get RuntimeError + SystemError
308308
# After fix: Should only get RuntimeError (no SystemError)
309309
with pytest.raises(RuntimeError) as exc_info:
310-
producer.flush(timeout=1.0)
310+
producer.flush(timeout=2.0) # Longer timeout to ensure delivery callback fires
311311

312312
# Verify we got an exception from our callback
313313
assert "Test exception from delivery_cb" in str(exc_info.value)
314314

315315
# Verify the delivery callback was actually called
316316
assert len(delivery_reports) > 0
317-
318-
producer.close()

0 commit comments

Comments
 (0)