Skip to content

fix: Implement thread-safe singleton Neo4j client with graceful shutdown#20

Open
Aish-kul16 wants to merge 1 commit into
MabudAlam:mainfrom
Aish-kul16:fix/neo4j-thread-safety
Open

fix: Implement thread-safe singleton Neo4j client with graceful shutdown#20
Aish-kul16 wants to merge 1 commit into
MabudAlam:mainfrom
Aish-kul16:fix/neo4j-thread-safety

Conversation

@Aish-kul16
Copy link
Copy Markdown

  • Added thread-safe get_neo4j_client() function using double-check locking pattern
  • Added close_neo4j_client() for graceful cleanup
  • Integrated shutdown event in FastAPI app lifecycle
  • Prevents race conditions and connection pool exhaustion under concurrent load

Fixes #17

- Added thread-safe get_neo4j_client() function using double-check locking pattern
- Added close_neo4j_client() for graceful cleanup
- Integrated shutdown event in FastAPI app lifecycle
- Prevents race conditions and connection pool exhaustion under concurrent load

Fixes MabudAlam#17
@Aish-kul16
Copy link
Copy Markdown
Author

Hi, @MabudAlam kindly review it and let me know feedback, Thank you!

@bugviper
Copy link
Copy Markdown

bugviper Bot commented May 20, 2026

⚠️ Repository not indexed. Please ingest the repository before requesting reviews:

  1. Go to the BugViper dashboard:
  2. Find your project and click 'Ingest Repository'
  3. Wait for indexing, then try mentioning @bugviper again!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Race Condition in Neo4j Connection Pool

1 participant