Skip to content

linstor: Fix a file handle resource leak opening template.properties#13091

Open
rp- wants to merge 1 commit intoapache:4.22from
LINBIT:linstor-4.22-fix-template-properties-resource-leak
Open

linstor: Fix a file handle resource leak opening template.properties#13091
rp- wants to merge 1 commit intoapache:4.22from
LINBIT:linstor-4.22-fix-template-properties-resource-leak

Conversation

@rp-
Copy link
Copy Markdown
Contributor

@rp- rp- commented May 1, 2026

Description

Fixes a file handle leak while checking the template.properties file.
This was introduced in df99a29

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Linstor cluster nfs mounts couldn't be unmounted anymore because the file was still opened.
After the fix, the leaked handle was gone and unmount worked.

How did you try to break this feature and the system with this change?

@rp- rp- added this to the 4.22.1 milestone May 1, 2026
@rp- rp- self-assigned this May 1, 2026
@rp- rp- requested review from DaanHoogland and sureshanaparti May 1, 2026 10:38
Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.68%. Comparing base (1f5dba9) to head (31d98de).

Files with missing lines Patch % Lines
.../hypervisor/kvm/storage/LinstorStorageAdaptor.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #13091      +/-   ##
============================================
- Coverage     17.68%   17.68%   -0.01%     
- Complexity    15791    15794       +3     
============================================
  Files          5922     5922              
  Lines        533085   533085              
  Branches      65205    65205              
============================================
- Hits          94270    94266       -4     
- Misses       428174   428180       +6     
+ Partials      10641    10639       -2     
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 18.75% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan package

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a file handle leak in the LINSTOR KVM storage adaptor when reading template.properties to detect the SystemVM template, preventing lingering open handles that can block unmounts.

Changes:

  • Wraps FileInputStream usage in isSystemTemplate(...) with try-with-resources to ensure the stream is always closed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17681

@sureshanaparti
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-16002)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 48806 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13091-t16002-kvm-ol8.zip
Smoke tests completed. 149 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

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

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants