Skip to content

QueueManager.disconnect() throws exception on disconnect failure #23

@andrewkirillov-ibm

Description

@andrewkirillov-ibm

Here is scenario how to reproduce:

  • Open connection a queue manager, keep it;
  • Go to your queue manager and stop it, so that connection get broken;
  • Close connection in the Python app.

It will cause exception:

Exception ignored in: <function QueueManager.__del__ at 0x7f3134006d40>
Traceback (most recent call last):
  File "/home/akirillo/mqgit/agents/mq-agents/src/mq-mcp-server/.venv/lib/python3.13/site-packages/ibmmq/mqqmgr.py", line 64, in __del__
    self.disconnect()
  File "/home/akirillo/mqgit/agents/mq-agents/src/mq-mcp-server/.venv/lib/python3.13/site-packages/ibmmq/mqqmgr.py", line 408, in disconnect
    mqlog.trace_exit("qmgr:disconnect", ep=2, rc=rv[2])
IndexError: tuple index out of range

The problem is that rv tuple has 2 values - COMP code and REASON. But the code does rv[2], which is out of range.

mqlog.trace_exit("qmgr:disconnect", ep=2, rc=rv[2])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions