[rocketmq-client-python] TransactionMQProducer allocates an unused producer during initialization

Open Beginner friendly
#11,492 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Read rocketmq/client.py, focusing on TransactionMQProducer.__init__ and the positional parameters in Producer.__init__. Run the offline recording-FFI regression described in the issue with the supplied option values. Done means construction calls only CreateTransactionProducer and applies each option once to that handle.

Written by the indexing model from the issue text.

Description

Component

apache/rocketmq-client-python, rocketmq/client.py, TransactionMQProducer.__init__.

Problem

TransactionMQProducer.__init__ calls the Producer initializer with positional arguments (group_id, timeout, compress_level, max_message_size). In Producer.__init__, the second positional parameter is orderly, followed by timeout, compress_level, and max_message_size. Thus construction first allocates a regular/orderly producer and then replaces _handle with the transaction-producer handle, losing the first native handle. When options are supplied, the base initializer also applies them to the discarded handle with shifted meanings before the transaction producer applies them again.

Expected behavior

Transaction-producer construction should allocate only its transaction-producer handle and apply each supplied option to that handle once.

Evidence

An offline recording-FFI regression test invokes the constructor with timeout=1234, compress_level=3, and max_message_size=2048. Before the fix it observes an unexpected CreateOrderlyProducer call; after the fix it observes only CreateTransactionProducer and the correctly targeted setters. No broker or native RocketMQ library is needed for this reproduction.

Scope

This issue concerns the Python wrapper's constructor/resource handling only. It does not require a broker, production data, credentials, or changes to RocketMQ server behavior.

Dominant language
Java
Stars
22.7k
Forks
12k
Avg merge
3d 18h
Merged PRs (30d)
17

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/rocketmq

All issues in apache/rocketmq

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.