-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AQ not enqueued even if transaction is completed? #331
Comments
Can you increase the Wait (in seconds) Deq options
|
I get same result with your options, I'm using latest version of this library. If I try
I think there's issue with enqueue.. |
Suprisingly, if I write this kind of go-native sql queries, data is enqueued as expected and dequeue on other process. |
That Wait is a time.Duration, so 1 is very small - use 1*time.Second if you want a second. |
I tried with 1 second now it returns 10/10, it still fails sometimes (9/10). I think the problem is "enqueue", as I've stated above, there's 0 message enqueued if I just try enqueue 10 message and exit. Am I missing something? |
For the failed case, Can you share the logs printed on console after setting the env |
Here's a reproducible environment with oracle container and godror driver in nix (non-nix requires env settings like ORACLE_HOME) Here's the code and debug log. https://github.com/aca/godror-issue-331/blob/c6fb69d4ee8cfbf167947ac334e34683dcd1fa26/main.go#L22 |
You should create a queue and use it, don't recreate it for each message! This AQ code does work in production for years now. |
Thanks! that fix issue on connection leak. It works fine. And thanks for your code. But this issue remains.. I wish I can re-use the queue object.
And.. even using single queue doesn't make enqueue work.
Question here..
|
It's not an error to create a new Queue object every time, just a performance penalty.
|
TestQueue (testQueue) in queue_test.go test right this scenario: enqueueing than dequeueing, in separate transactions, with freshly created Queue objects. |
Test results OK, but not sure what this means..
Okay I'll try to add some subtest when I can. |
Hi, I was having issue with #93 (comment), but besides connection pool issue, I also found wierd behavior on AQ with the same code.
I'm sorry but I'm not familiar with AQ. Please correct me if I'm doing something wrong...
Describe the bug
I tried to write code that just enqueue data and dequeue data one by one 10 times. But even though enqueue transaction is completed, dequeue fails sometimes.
I enqueued 10 data but dequeue success only 7 times.
And I rerun the same code it acts like it never enqueued. (If is enqueued correctly queue should have 3 message)
To Reproduce
Environment and code is basically same as #93. But I set
standaloneConnection=true
.Error output
Expected behavior
It should not print
no message found
Your oracle client version
21.10.0.0.0
Your godror version
v0.41.1-0.20240114194139-fdee3321b7db
Your go version
1.22
Your gcc version
12.3.0
Machine (please complete the following information):
The text was updated successfully, but these errors were encountered: