Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,17 @@ private void handleConfigureStatus(StatusCategory confStatusCategory) {

if (genericResult.isFailure()) {
logger.error("Failed to send closeQueue request. RC={}", genericResult);
setQueueState(QueueState.e_CLOSED);
if (scenario.isDefault()) {
// If no connection the queue now is closed.
onFullyClosed();
if (genericResult.isNotConnected()) {
genericResult = GenericResult.SUCCESS;
}

@678098 678098 Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else {
// The late scenarios have already removed the queue from the
// active maps, so just mark it closed (mirrors onCloseResponse()).
setQueueState(QueueState.e_CLOSED);
}

resultHook(genericResult);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,9 @@ void closeQueueRequestFailsTest() {

obj.sendConfigureStreamResponse(configureRequest);

assertEquals(CloseQueueResult.NOT_CONNECTED, closeFuture.get(FUTURE_TIMEOUT));
// With no connection the queue is considered closed, so close
// reports success.
assertEquals(CloseQueueResult.SUCCESS, closeFuture.get(FUTURE_TIMEOUT));

// Check close request
obj.verifyCloseQueueRequest(true);
Expand All @@ -1266,21 +1268,16 @@ void closeQueueRequestFailsTest() {

// Check event
obj.verifyQueueControlEvent(
QueueControlEvent.Type.e_QUEUE_CLOSE_RESULT, CloseQueueResult.NOT_CONNECTED);
QueueControlEvent.Type.e_QUEUE_CLOSE_RESULT, CloseQueueResult.SUCCESS);

assertEquals(QueueState.e_CLOSED, queue.getState());

// Open the queue
obj.connection().resetWriteStatus(); // SUCCESS

// Due to the bug, queue is not closed fully, so we cannot reopen it
logger.info("[BUG] Current queue cannot be reopened");
assertEquals(
OpenQueueResult.QUEUE_ID_NOT_UNIQUE,
queue.open(queueOptions, SEQUENCE_TIMEOUT));

// Create and open another queue
queue = obj.createQueue(createUri(), flags);
// The queue is fully closed and no longer registered in the active
// queue map, so the same queue can be reopened.
assertNull(obj.queueManager().findByQueueId(queue.getFullQueueId()));

obj.openQueue(queue, queueOptions);

Expand Down
Loading