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: process annotation insertions after spans #4084

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/phoenix/db/bulk_inserter.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ async def _bulk_insert(self) -> None:
or self._spans
or self._evaluations
):
if not self._queue_inserters.empty:
if inserted_ids := await self._queue_inserters.insert():
for project_rowid in await self._get_project_rowids(inserted_ids):
self._last_updated_at_by_project[project_rowid] = datetime.now(timezone.utc)
if self._operations.empty() and not (self._spans or self._evaluations):
await asyncio.sleep(self._sleep)
continue
Expand Down Expand Up @@ -200,6 +196,10 @@ async def _bulk_insert(self) -> None:
evaluations_buffer = None
for project_rowid in transaction_result.updated_project_rowids:
self._last_updated_at_by_project[project_rowid] = datetime.now(timezone.utc)
if not self._queue_inserters.empty:
if inserted_ids := await self._queue_inserters.insert():
for project_rowid in await self._get_project_rowids(inserted_ids):
self._last_updated_at_by_project[project_rowid] = datetime.now(timezone.utc)
await asyncio.sleep(self._sleep)

async def _insert_spans(self, spans: List[Tuple[Span, str]]) -> TransactionResult:
Expand Down
4 changes: 2 additions & 2 deletions src/phoenix/db/insertion/constants.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DEFAULT_RETRY_DELAY_SEC: float = 60
DEFAULT_RETRY_ALLOWANCE: int = 10
DEFAULT_RETRY_DELAY_SEC: float = 10
DEFAULT_RETRY_ALLOWANCE: int = 60
Loading