LinearClient.defaultBackend makes a new HttpClient for each call and never closes it #643

Open
opened 2026-09-26 04:48:08 +00:00 by claude · 2 comments
Member

Found during IW-637. private def defaultBackend: SyncBackend = DefaultSyncBackend() is a def, so each call to a LinearClient method that uses the default backend makes a new HttpClient and never closes it — core/adapters/LinearClient.scala:16.

Found during IW-637. `private def defaultBackend: SyncBackend = DefaultSyncBackend()` is a `def`, so each call to a `LinearClient` method that uses the default backend makes a new `HttpClient` and never closes it — `core/adapters/LinearClient.scala:16`.
Author
Member

Two more core/adapters/LinearClient.scala items, found in IW-701:

  • Linear issueSearch is deprecated in favour of searchIssues; buildSearchIssuesQuery still uses issueSearch — Linear schema.
  • LinearClient.buildLinearQuery still interpolates issueId.value into GraphQL text beside graphqlRequest; safe only while IssueId stays regex-validated — IW-701 review-phase-01-20261008-071827.md (security, composition, architecture).
Two more `core/adapters/LinearClient.scala` items, found in IW-701: - [ ] Linear `issueSearch` is deprecated in favour of `searchIssues`; `buildSearchIssuesQuery` still uses `issueSearch` — Linear schema. - [ ] `LinearClient.buildLinearQuery` still interpolates `issueId.value` into GraphQL text beside `graphqlRequest`; safe only while `IssueId` stays regex-validated — IW-701 review-phase-01-20261008-071827.md (security, composition, architecture).
Author
Member

Intake: needs-input
Workflow: diagnostic
Reason: G7 (1 [human] finding)
Analysis: project-management/issues/IW-643/analysis.md on branch IW-643

1. Should IW-643 also fix the same HttpClient leak in ForgejoClient and YouTrackClient, or only in LinearClient? (G7)

The issue names only LinearClient.defaultBackend. The analysis widens the fix on its own initiative. Its claim that "no other open issue covers ForgejoClient or YouTrackClient" has no evidence, and the repository cannot confirm it. Both clients use the same definition: ForgejoClient.scala#L34 and YouTrackClient.scala#L17. The dashboard pollers call ForgejoClient most often. See the analysis scope decision.

private def defaultBackend: SyncBackend = DefaultSyncBackend()

  • a) Fix all three clients in IW-643. Phase 1 stays as written. It costs two more defaultBackend changes, two more docs/api files and more test assertions.
  • b) Fix only LinearClient and record the other two clients in FOLLOW-UPS.md. The scope matches the issue. The leak in the Forgejo pollers stays until a separate issue fixes it. Phase 1 in tasks.md must be cut down.

Recommended: a): it is the same defect with the same one-line cause, and ForgejoClient leaks the most in the dashboard, so a separate issue would repeat the same work.

Answer in a comment on this issue, per number, for example "1: a", or in your own words; intake reads it on its next iteration.

Intake: needs-input Workflow: diagnostic Reason: G7 (1 [human] finding) Analysis: project-management/issues/IW-643/analysis.md on branch IW-643 ### 1. Should IW-643 also fix the same HttpClient leak in ForgejoClient and YouTrackClient, or only in LinearClient? (G7) The issue names only `LinearClient.defaultBackend`. The analysis widens the fix on its own initiative. Its claim that "no other open issue covers ForgejoClient or YouTrackClient" has no evidence, and the repository cannot confirm it. Both clients use the same definition: [ForgejoClient.scala#L34](https://code.iterative.works/iterative-works/iw-cli/src/branch/IW-643/core/adapters/ForgejoClient.scala#L34-L34) and [YouTrackClient.scala#L17](https://code.iterative.works/iterative-works/iw-cli/src/branch/IW-643/core/adapters/YouTrackClient.scala#L17-L17). The dashboard pollers call ForgejoClient most often. See the [analysis scope decision](https://code.iterative.works/iterative-works/iw-cli/src/branch/IW-643/project-management/issues/IW-643/analysis.md#L53-L59). > private def defaultBackend: SyncBackend = DefaultSyncBackend() - **a) Fix all three clients in IW-643.** Phase 1 stays as written. It costs two more `defaultBackend` changes, two more docs/api files and more test assertions. - **b) Fix only LinearClient and record the other two clients in FOLLOW-UPS.md.** The scope matches the issue. The leak in the Forgejo pollers stays until a separate issue fixes it. Phase 1 in tasks.md must be cut down. **Recommended: a)**: it is the same defect with the same one-line cause, and ForgejoClient leaks the most in the dashboard, so a separate issue would repeat the same work. Answer in a comment on this issue, per number, for example "1: a", or in your own words; intake reads it on its next iteration.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#643
No description provided.