Probe: the container needs no try block #10

Closed
werkprobe-dev wants to merge 1 commits from test/03-probe-simplified into main
Collaborator

The JVM ends when main returns, so the container needs no try-with-resources block.

The JVM ends when main returns, so the container needs no try-with-resources block.
werkprobe-dev added 1 commit 2026-10-05 05:16:13 +02:00
Probe: the container needs no try block, the JVM ends with main anyway
werkator build succeeded after 03:01
ai-review/assessment rule violated; a new commit that fixes it is required; changes requested by werkrevisor
ai-review/gate build failed after 00:56
4b194aadb5
werkprobe-dev marked the pull request as work in progress 2026-10-05 05:46:34 +02:00
werkprobe-dev marked the pull request as ready for review 2026-10-05 05:50:14 +02:00
Collaborator

🔴 werkrevisor: RED / CHANGES_REQUIRED

Change kind: refactoring.

Reasons

  • RED model reports 2 key issues (threshold 2)
  • YELLOW model recommends merge with caution

Findings

  1. Container Not Stopped at src/main/java/werkprobe/Probe.java:32-34

    Removing try-with-resources means postgres.close() is never called. The PR rationale ("the JVM ends when main returns") is not reliable for Testcontainers. Ryuk, the reaper container, is a safety net that is often disabled (TESTCONTAINERS_RYUK_DISABLED=true), for example in CI or rootless/restricted Docker setups. In those setups the Postgres container is left running after the probe exits. If main throws after start(), for example on a JDBC failure, the container is also not stopped by the code itself. A probe that is run repeatedly would leak containers and ports. Keep the try-with-resources block or call postgres.stop() in a finally block.

  2. Leftover Bare Block at src/main/java/werkprobe/Probe.java:34

    The diff leaves a bare { block at line 34 where the try used to be, and it is only there to keep the old nesting. The block does nothing, makes the code harder to read, and suggests an incomplete refactor. The visible hunk does not show the matching closing brace, so confirm the braces still balance. Remove the block and de-indent its body if the try block is dropped.

Usage: model `openrouter/anthropic/claude-sonnet-5.5`, LLM done, calls 1, tokens in 3497 / out 590 (reasoning included in out), duration 0.0 s, cost 0.0129 USD (reported).
Reviewed head `4b194aadb595a1a24790b79f0dd0cbae035ea448` against base `520dffc37b99224be8550f05714af7e7ac99563e`, werkrevisor 0.2.0.
<!-- werkrevisor:4b194aadb595a1a24790b79f0dd0cbae035ea448 --> <!-- werkrevisor-verdict:RED --> ## 🔴 werkrevisor: RED / CHANGES_REQUIRED Change kind: `refactoring`. ### Reasons - **RED** model reports 2 key issues (threshold 2) - **YELLOW** model recommends merge with caution ### Findings 1. **Container Not Stopped** at `src/main/java/werkprobe/Probe.java:32-34` Removing try-with-resources means `postgres.close()` is never called. The PR rationale ("the JVM ends when main returns") is not reliable for Testcontainers. Ryuk, the reaper container, is a safety net that is often disabled (`TESTCONTAINERS_RYUK_DISABLED=true`), for example in CI or rootless/restricted Docker setups. In those setups the Postgres container is left running after the probe exits. If `main` throws after `start()`, for example on a JDBC failure, the container is also not stopped by the code itself. A probe that is run repeatedly would leak containers and ports. Keep the try-with-resources block or call `postgres.stop()` in a `finally` block. 2. **Leftover Bare Block** at `src/main/java/werkprobe/Probe.java:34` The diff leaves a bare `{` block at line 34 where the `try` used to be, and it is only there to keep the old nesting. The block does nothing, makes the code harder to read, and suggests an incomplete refactor. The visible hunk does not show the matching closing brace, so confirm the braces still balance. Remove the block and de-indent its body if the try block is dropped. <sub> Usage: model `openrouter/anthropic/claude-sonnet-5.5`, LLM done, calls 1, tokens in 3497 / out 590 (reasoning included in out), duration 0.0 s, cost 0.0129 USD (reported).<br> Reviewed head `4b194aadb595a1a24790b79f0dd0cbae035ea448` against base `520dffc37b99224be8550f05714af7e7ac99563e`, werkrevisor 0.2.0. </sub>
ai-reviewer left a comment
Collaborator

werkrevisor: RED / CHANGES_REQUIRED for 4b194aadb595a1a24790b79f0dd0cbae035ea448.

  • Container Not Stopped at src/main/java/werkprobe/Probe.java:32-34
  • Leftover Bare Block at src/main/java/werkprobe/Probe.java:34
    Details: #10 (comment)
werkrevisor: RED / CHANGES_REQUIRED for `4b194aadb595a1a24790b79f0dd0cbae035ea448`. - Container Not Stopped at `src/main/java/werkprobe/Probe.java:32-34` - Leftover Bare Block at `src/main/java/werkprobe/Probe.java:34` Details: http://git.javagil.de/mi/werkprobe/pulls/10#issuecomment-775 <!-- werkrevisor-review:4b194aadb595a1a24790b79f0dd0cbae035ea448 -->
Collaborator

Closed: this was acceptance case 3 of the werkrevisor rollout, a change with a built-in error (the Postgres container is never stopped, and an empty block is left behind). It must never be merged. werkrevisor judged it RED with both findings, as it should; the case also served as case 6, the repeated run. The result is recorded in werkrevisor's docs/betrieb-git.javagil.de.md, section "Abnahme".

Closed: this was acceptance case 3 of the werkrevisor rollout, a change with a built-in error (the Postgres container is never stopped, and an empty block is left behind). It must never be merged. werkrevisor judged it RED with both findings, as it should; the case also served as case 6, the repeated run. The result is recorded in werkrevisor's docs/betrieb-git.javagil.de.md, section "Abnahme".
claude-code closed this pull request 2026-10-10 13:36:37 +02:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Reviewers
No labels
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mi/werkprobe#10