← Back to Pull requests

[ZEPPELIN-6394] Fix concurrent file write issue when saving interpreter settings #5144

Closed
unknown closed this pull request without merging on Oct 08, 2026 09:37 UTC
View on GitHub
unknown unknown commented on Jan 23, 2026 08:26 UTC
Author

What is this PR for?

Fix concurrent case throws java.nio.file.NoSuchFileException

https://github.com/apache/zeppelin/blob/8251dc4e013cde02879d186240155da8f996bdb7/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java#L1011-L1015

<img width="1959" height="956" alt="3a885fb1-f192-4693-94d1-a7eef140d030" src="https://github.com/user-attachments/assets/f01d7ef0-2b84-4ad9-ba28-67ea011c135c" />

Problem


When multiple interpreters download dependencies simultaneously during startup or other cases, the saveToFile() method can be called concurrently by multiple threads. This happens because loadInterpreterDependencies() spawns asynchronous threads that call saveToFile() when dependency download completes.

Solution


Add synchronized keyword to InterpreterSettingManager.saveToFile() method to ensure thread-safe file operations. This prevents multiple threads from writing to the configuration file simultaneously.

Impact


  • Startup: Multiple interpreters downloading dependencies will serialize their save operations, ensuring data consistency

  • Runtime: All file save operations (interpreter settings, repositories) are protected from race conditions

  • Performance: Minimal impact as file save operations are fast and infrequent relative to dependency download time

  • What type of PR is it?


    Bug Fix

    Todos


    [ ] - Task

    What is the Jira issue?


    https://issues.apache.org/jira/browse/ZEPPELIN-6394

    How should this be tested?


    Strongly recommended: add automated unit tests for any new or changed behavior
    Outline any manual steps to test the PR here.

    Screenshots (if appropriate)

    Questions:


    Does the license files need to update?
    Is there breaking changes for older versions?
    Does this needs documentation?

    Diff: 230 lines (+172 / -58) across 2 files Reviewer: Reamer Review duration: 371591m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 230 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.326
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5144"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37% (MEDIUM) · Higher = larger blast radius
    37%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.6% · Safe to merge
    14.6%