Skip to content

Address code review feedback: fix exception handling, async lock initialization, and concurrency protection#101

Merged
MarcSkovMadsen merged 2 commits into
fix/windows-fixesfrom
copilot/sub-pr-100
Jan 12, 2026
Merged

Address code review feedback: fix exception handling, async lock initialization, and concurrency protection#101
MarcSkovMadsen merged 2 commits into
fix/windows-fixesfrom
copilot/sub-pr-100

Conversation

Copilot AI commented Jan 11, 2026

Copy link
Copy Markdown
Contributor

Addresses 5 review comments from PR #100 on exception handling, async lock initialization, and database concurrency protection.

Changes

  • Exception handling: Changed bare except: to except Exception: in utils.py to avoid catching system-exiting exceptions (SystemExit, KeyboardInterrupt)

  • Async lock initialization: Made _db_lock lazy-initialized via property to prevent event loop context issues when DocumentationIndexer is instantiated outside async contexts:

@property
def db_lock(self) -> asyncio.Lock:
    """Lazy-initialize and return the database lock."""
    if self._db_lock is None:
        self._db_lock = asyncio.Lock()
    return self._db_lock
  • Concurrency protection: Wrapped index_documentation method in __init__ to ensure all invocations (including direct calls from update_index tool and run method) automatically acquire the database lock, preventing race conditions with concurrent search operations

  • Code cleanup: Removed useless try-except block that caught and immediately re-raised exceptions, and removed unused param import from tests


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Jan 11, 2026
…x asyncio.Lock init, protect index_documentation with lock, remove useless try-except

Co-authored-by: MarcSkovMadsen <42288570+MarcSkovMadsen@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Windows-specific issues in HoloViz MCP display server Address code review feedback: fix exception handling, async lock initialization, and concurrency protection Jan 11, 2026
Copilot AI requested a review from MarcSkovMadsen January 11, 2026 20:15

@MarcSkovMadsen MarcSkovMadsen left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good

@MarcSkovMadsen
MarcSkovMadsen marked this pull request as ready for review January 11, 2026 20:20
@MarcSkovMadsen
MarcSkovMadsen merged commit b991260 into fix/windows-fixes Jan 12, 2026
2 checks passed
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.

2 participants