Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Watch Mode #1202

Merged
merged 1 commit into from
Dec 24, 2024
Merged

Fix Watch Mode #1202

merged 1 commit into from
Dec 24, 2024

Conversation

CalebCourier
Copy link
Collaborator

Addresses #1201

Bug Description

Previously, operations on the SQLite DB used for watch mode (intended for local dev) were always run because they were fired from the legacy telemetry flow. This had the potential to cause DB lock errors if the user was using high rates of concurrency like noted in #1201.
Now, we avoid making calls to this SQLite DB unless watch mode is explicitly enabled via the --watch flag on the guardrails start command.

This isn't a perfect solution, because it forces the user to specify the "watch" functionality in two places:

  1. in guardrails start --watch to enable collecting logs
  2. in guardrails watch to tail the logs in a separate console tab

However there is not an easy way to communicate between these two commands since they currently exist as separate and unrelated processes.

This is technically a breaking change since it requires additional user interaction to obtain the same behaviour that previously was obtained without the addtional flag, but no one has used the guardrails watch command within the retention window of our metrics so it shouldn't matter.

Additionally, this entire "watch" functionality can, and probably should, just be handled by a logger in the same process as the guardrails-api. The current setup is a significant amount of overhead for something that essentially just prints out ValidatorLogs.

@CalebCourier CalebCourier requested a review from zsimjee December 24, 2024 19:43
@CalebCourier
Copy link
Collaborator Author

Notebook passed on this branch: https://github.com/guardrails-ai/guardrails/actions/runs/12485660213

@zsimjee zsimjee merged commit 078200e into main Dec 24, 2024
35 checks passed
@zsimjee zsimjee deleted the fix-watch branch December 24, 2024 20:56
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