Skip to content

Neo4j connection timeout failure in VS Code extension #63

@rysweet

Description

@rysweet

Problem

The Blarify VS Code extension is experiencing critical Neo4j connection failures with multiple concurrent connection attempts and eventual timeout after 60 seconds.

Error Details

[Neo4j ERROR] Failed to start Neo4j container
[Neo4j] Container manager start failed: Neo4j failed to start within 60000ms
[Neo4j] Error details: Error: Neo4j failed to start within 60000ms
    at Neo4jContainerManager.waitForNeo4j (/Users/ryan/.vscode-insiders/extensions/blarify.blarify-visualizer-0.1.0/bundled/neo4j-container-manager/container-manager.js:275:15)
    at Neo4jContainerManager.reuseExistingContainer (/Users/ryan/.vscode-insiders/extensions/blarify.blarify-visualizer-0.1.0/bundled/neo4j-container-manager/container-manager.js:214:9)
    at Neo4jContainerManager.start (/Users/ryan/.vscode-insiders/extensions/blarify.blarify-visualizer-0.1.0/bundled/neo4j-container-manager/container-manager.js:56:34)

Symptoms

  1. Multiple concurrent connection attempts: The logs show the container manager being called 3 times simultaneously
  2. Successful connections ignored: Two attempts return successfully (24390ms and 37073ms) but a third attempt times out at 60000ms
  3. Container actually running: The container ID 2d283cf877e9254ac2943210555480458d1592cd588c93f5b7e4bed333cd2225 is running on port 7957
  4. Subsequent checks show healthy: After the timeout error, status checks report "Existing instance is healthy"

Root Cause Analysis

The issue appears to be:

  • Multiple concurrent calls to ensureRunning() during extension activation
  • Race condition where multiple connection attempts overlap
  • The 60-second timeout fires even though the container started successfully in ~24-37 seconds
  • No proper synchronization/locking mechanism to prevent concurrent initialization

Impact

  • Extension fails to initialize properly
  • User sees error messages despite Neo4j actually running
  • Poor user experience with unreliable startup
  • Blocks core functionality of the Blarify extension

Expected Behavior

  • Single connection attempt during startup
  • Proper synchronization to prevent race conditions
  • Recognition of successful container start regardless of timeout
  • Reliable, consistent Neo4j initialization

Environment

  • VS Code Insiders
  • Extension version: 0.1.0
  • Neo4j container manager bundled with extension
  • macOS (Darwin)

Priority

CRITICAL - This is a core reliability issue that affects all users and makes the extension appear broken even when Neo4j is actually running successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions