allthingssecurity opened a new pull request, #27309: URL: https://github.com/apache/camel/pull/27309
# Description [CAMEL-25280](https://issues.apache.org/jira/browse/CAMEL-25280) Follow-up of #27242 (CAMEL-25245), as suggested in its review. `SnmpProducer` kept one request PDU in a field, created in `doStart`. The producer of an endpoint is shared by all its concurrent exchanges, and the `GET_NEXT` walk changes that PDU for every request (`clear()`, then the next OID). SNMP4J also encodes the same PDU object again when it retries after a timeout. So walks running at the same time on one endpoint changed each other's requests: a walk whose request was retried while another walk ran got the answer for the other walk's last OID, ended its subtree early and returned an incomplete list, without an error. This change creates the request PDU for each exchange (the code that built it in `doStart` moves to a method that `process` calls). Tests: - `ConcurrentWalkTest` (new): an SNMP4J test agent with two subtrees that does not answer the very first request. A first walk starts; once its first request was dropped, a second walk runs on the same endpoint while the first waits for its retry. - Without the change the first walk returns `[b1, b2]` instead of `[a1, a2, b1, b2]`. - With the change all camel-snmp tests pass: 16 tests, 0 failures. Conflicts with #27242: both change the lines of the walk loop. The same change applied on top of #27242 passes there too (22 tests); whichever is merged second needs a small rebase (the walk uses the local `pdu` instead of `this.pdu`). # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (I built and tested the affected module, including the formatter and import-sort plugins. I did not run the full root build.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. _Claude Code on behalf of allthingssecurity_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
