Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(signals): evict stale db connections in grouping activities (#62634)

Andrew Maguirefca49e463403
diff --git a/products/signals/backend/temporal/grouping.py b/products/signals/backend/temporal/grouping.py
index 75cb747fcfc5..a7aa1ad73396 100644
--- a/products/signals/backend/temporal/grouping.py
+++ b/products/signals/backend/temporal/grouping.py
@@ -196,6 +196,7 @@ class GenerateSearchQueriesOutput:
@temporalio.activity.defn
@scoped_temporal()
+@close_db_connections
async def generate_search_queries_activity(input: GenerateSearchQueriesInput) -> GenerateSearchQueriesOutput:
"""Use LLM to generate 1-3 search queries for finding related signals."""
try:
@@ -489,6 +490,7 @@ class MatchSignalToReportInput:
@temporalio.activity.defn
@scoped_temporal()
+@close_db_connections
async def match_signal_to_report_activity(input: MatchSignalToReportInput) -> MatchResult:
"""Determine if a new signal matches an existing report or needs a new one."""
try:
@@ -612,6 +614,7 @@ async def verify_match_specificity(
@temporalio.activity.defn
@scoped_temporal()
+@close_db_connections
async def verify_match_specificity_activity(input: VerifyMatchSpecificityInput) -> VerifyMatchSpecificityOutput:
"""Verify that adding a signal to a group produces a specific-enough PR title."""
try: