-
Notifications
You must be signed in to change notification settings - Fork 583
hotfix: stabilize sync jobs with reduced concurrency and enhanced deadlock handling #1090
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 9 files
Prompt for AI agents (all 2 issues)
Understand the root cause of the following 2 issues and fix them.
<file name="backend/airweave/platform/converters/mistral_converter.py">
<violation number="1" location="backend/airweave/platform/converters/mistral_converter.py:123">
Rule violated: **Check for Cursor Rules Drift**
Cursor backend rules already require duration measurements to use time.monotonic(), but this new timing instrumentation in convert_batch relies on time.time(). Please switch this and the other stage timings in this block to time.monotonic() so the implementation matches the documented backend rule.</violation>
</file>
<file name="backend/airweave/platform/sync/orchestrator.py">
<violation number="1" location="backend/airweave/platform/sync/orchestrator.py:70">
Rule violated: **Check for Cursor Rules Drift**
Cleanup-phase logging was downgraded to DEBUG, but the sync-architecture Cursor rule still instructs INFO-level logging for these 🧹 messages. Please update the rule to reflect the new logging level so Cursor guidance stays accurate.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| """ | ||
| import time | ||
|
|
||
| batch_start = time.time() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rule violated: Check for Cursor Rules Drift
Cursor backend rules already require duration measurements to use time.monotonic(), but this new timing instrumentation in convert_batch relies on time.time(). Please switch this and the other stage timings in this block to time.monotonic() so the implementation matches the documented backend rule.
Prompt for AI agents
Address the following comment on backend/airweave/platform/converters/mistral_converter.py at line 123:
<comment>Cursor backend rules already require duration measurements to use time.monotonic(), but this new timing instrumentation in convert_batch relies on time.time(). Please switch this and the other stage timings in this block to time.monotonic() so the implementation matches the documented backend rule.</comment>
<file context>
@@ -118,48 +118,104 @@ async def convert_batch(self, file_paths: List[str]) -> Dict[str, str]:
"""
+ import time
+
+ batch_start = time.time()
+ logger.debug(f"🔶 Mistral Converter: Starting batch conversion of {len(file_paths)} files")
+
</file context>
| self.sync_context.logger.debug("🚀 PHASE 1: Starting sync initialization...") | ||
| await self._start_sync() | ||
| self.sync_context.logger.info(f"✅ PHASE 1 complete ({time.time() - phase_start:.2f}s)") | ||
| self.sync_context.logger.debug( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rule violated: Check for Cursor Rules Drift
Cleanup-phase logging was downgraded to DEBUG, but the sync-architecture Cursor rule still instructs INFO-level logging for these 🧹 messages. Please update the rule to reflect the new logging level so Cursor guidance stays accurate.
Prompt for AI agents
Address the following comment on backend/airweave/platform/sync/orchestrator.py at line 70:
<comment>Cleanup-phase logging was downgraded to DEBUG, but the sync-architecture Cursor rule still instructs INFO-level logging for these 🧹 messages. Please update the rule to reflect the new logging level so Cursor guidance stays accurate.</comment>
<file context>
@@ -65,33 +65,41 @@ async def run(self) -> schemas.Sync:
+ self.sync_context.logger.debug("🚀 PHASE 1: Starting sync initialization...")
await self._start_sync()
- self.sync_context.logger.info(f"✅ PHASE 1 complete ({time.time() - phase_start:.2f}s)")
+ self.sync_context.logger.debug(
+ f"✅ PHASE 1 complete ({time.time() - phase_start:.2f}s)"
+ )
</file context>
Summary by cubic
Stabilizes sync runs by reducing concurrency and hardening deadlock handling. Adds an async dedup lock, smarter DB retries, and moves noisy logs to debug with timing across the pipeline.
Bug Fixes
Performance
Written for commit d0d3f12. Summary will update automatically on new commits.