Skip to content

iris.ref() values not cleaned up on exception #14

Description

@reet0512
  • iris kit details: 'any'
  • operating system: 'any'
  • python version: 'any'
  • error message: 'N/A — no crash, but resources held longer than necessary'

Steps to Reproduce:

  1. Have a BusinessService/BusinessProcess/BusinessOperation call SendRequestSync
  2. Have the IRIS-side call throw an exception (timeout, connection drop, invalid request)
  3. The iris.ref() cleanup lines are unreachable

Minimal Example

# In _production_connector.py, the pattern is:
response = iris.ref()
status = self.iris_host_object.SendRequestSync(...)  # can throw
response_value = response.value    # unreachable on exception
response.value = None              # unreachable
del response                       # unreachable

Expected Behaviour

iris.ref() objects are cleaned up regardless of whether the call succeeds or fails.

Actual Behaviour

On exception, cleanup is skipped. Python's GC will eventually collect the ref object
when the traceback is released, but until then the IRIS-side object it references stays
pinned. In a long-running production with intermittent failures, this means IRIS resources
are held longer than necessary (duration depends on how long the exception/traceback lives
in the error handling chain).

This is a robustness/hygiene issue rather than a critical bug — the process doesn't crash
and GC will eventually reclaim the resources. But in long-running workers it's better to
release immediately via try/finally.

Additional Information

Affected methods:

  • BusinessService.SendRequestSync
  • BusinessProcess.SendRequestSync
  • BusinessOperation.SendRequestSync
  • InboundAdapter.BusinessHost_ProcessInput
  • AdapterNamesToPascal method wrapper

Suggested fix: wrap in try/finally to ensure response.value = None runs unconditionally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions