Skip to content

fix: avoid creating SOAR session on close - #260

Merged
dandye merged 1 commit into
google:mainfrom
Haihan-Jiang:avoid-creating-soar-session-on-close
Aug 29, 2026
Merged

dandye merged 1 commit into
google:mainfrom
Haihan-Jiang:avoid-creating-soar-session-on-close

Conversation

@Haihan-Jiang

Copy link
Copy Markdown
Contributor

HttpClient.close() should only close an existing aiohttp session. Calling _get_session() inside close() creates a new session just to close it, which gives cleanup an unnecessary side effect.

This skips the close call when no session has been created yet.

Tests:

  • python3 -m py_compile server/secops-soar/secops_soar_mcp/http_client.py
  • PYTHONPATH=/tmp/mcp-security-http-deps:server/secops-soar python3 - <<'PY' ... smoke test for closing a client before any request creates a session
  • git diff --check
@Haihan-Jiang
Haihan-Jiang requested a review from a team May 26, 2026 08:59
@Haihan-Jiang

Copy link
Copy Markdown
Contributor Author

This is ready for review. Closing a SOAR session no longer creates a new session, and the visible checks are green.

@dandye dandye self-assigned this Aug 29, 2026
@dandye
dandye merged commit 8eb8a81 into google:main Aug 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants