apache / apache/camel-quarkus

JT400 Minor issue with resource allocated to another job

Open
#6,273 0 comments 0 reactions 0 assignees View on GitHub
area/jt400 bug
Dominant language
Java
Stars
302
Forks
232
Avg merge
1d 20h
Merged PRs (30d)
114

Description

### Bug description

When JT400 test module is executed with real service and one process is reading/wring a message. The second process might get an error response `CPF2451 Message queue D_REPLMSGQ is allocated to another job`.

This allocation is released after several seconds and the test contains a nawait timeout to overcome this issue. See the [code](https://github.com/apache/camel-quarkus/blob/main/integration-tests/jt400/src/test/java/org/apache/camel/quarkus/component/jt400/it/Jt400Test.java#L43).

If you run several tests in parallel. For example using a script like:
```
for i in {1..2}
do
(mvn clean test -f integration-tests/jt400 -Dquarkus.http.test-port=808$i | sed "s/^/[Run $i] /") | tee jt400_$i.log &
done
```

and if you lower the [timeout](https://github.com/apache/camel-quarkus/blob/main/integration-tests/jt400/src/test/java/org/apache/camel/quarkus/component/jt400/it/Jt400Test.java#L43) to i.e. 2 seconds. You should see the error.

I see 2 reason of this error:

1. **Some jt400 configuration forces the timeout**
2. There is an issue in releasing the jt400 connection by camel-jt400 component. (I was checking the code, but I havem't found any problem there)

From my POV, the issue is not a major, but happens only in parallel access to one resource and the timeout is quite low.

Contributor guide

No contributing guide indexed for this repository

Research direction

Run the provided parallel Maven commands for integration-tests/jt400, then inspect Jt400Test.java around the nawait timeout and the JT400 test setup. Determine whether the allocation error comes from configuration or connection release; done means the cause is established and parallel runs no longer depend on the timeout workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.