From 4526efa662505259947ee4604c357b454cd5fe4c Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Mon, 18 Nov 2024 20:07:13 +0530 Subject: [PATCH 1/3] add error logs, fix log graph --- flow/activities/flowable.go | 2 ++ ui/app/peers/[peerName]/lagGraph.tsx | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/flow/activities/flowable.go b/flow/activities/flowable.go index cc09bae0d..8a65f5dde 100644 --- a/flow/activities/flowable.go +++ b/flow/activities/flowable.go @@ -287,11 +287,13 @@ func (a *FlowableActivity) MaintainPull( ctx = context.WithValue(ctx, shared.FlowNameKey, config.FlowJobName) srcConn, err := connectors.GetByNameAs[connectors.CDCPullConnector](ctx, config.Env, a.CatalogPool, config.SourceName) if err != nil { + a.Alerter.LogFlowError(ctx, config.FlowJobName, err) return err } defer connectors.CloseConnector(ctx, srcConn) if err := srcConn.SetupReplConn(ctx); err != nil { + a.Alerter.LogFlowError(ctx, config.FlowJobName, err) return err } diff --git a/ui/app/peers/[peerName]/lagGraph.tsx b/ui/app/peers/[peerName]/lagGraph.tsx index 87b90fa8c..3afe75d4b 100644 --- a/ui/app/peers/[peerName]/lagGraph.tsx +++ b/ui/app/peers/[peerName]/lagGraph.tsx @@ -21,8 +21,11 @@ type LagGraphProps = { function parseLSN(lsn: string): number { if (!lsn) return 0; const [lsn1, lsn2] = lsn.split('/'); + const parsedLsn1 = parseInt(lsn1, 16); + const parsedLsn2 = parseInt(lsn2, 16); + if (isNaN(parsedLsn1) || isNaN(parsedLsn2)) return 0; return Number( - (BigInt(parseInt(lsn1, 16)) << BigInt(32)) | BigInt(parseInt(lsn2, 16)) + (BigInt(parsedLsn1) << BigInt(32)) | BigInt(parsedLsn2) ); } From ffde67db9d67c4134c10e314415260b63e14624c Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Mon, 18 Nov 2024 20:12:52 +0530 Subject: [PATCH 2/3] fix sign in alert --- flow/alerting/alerting.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/alerting/alerting.go b/flow/alerting/alerting.go index 5f05005d1..69282330d 100644 --- a/flow/alerting/alerting.go +++ b/flow/alerting/alerting.go @@ -356,7 +356,7 @@ func (a *Alerter) checkAndAddAlertToCatalog(ctx context.Context, alertConfigId i return true } - logger.Info(fmt.Sprintf("Skipped sending alerts: last alert was sent at %s, which was >=%s ago", createdTimestamp.String(), dur.String())) + logger.Info(fmt.Sprintf("Skipped sending alerts: last alert was sent at %s, which was <=%s ago", createdTimestamp.String(), dur.String())) return false } From 360991f93f78adfaaf894895a6b67794fa0a3a7f Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Mon, 18 Nov 2024 22:11:25 +0530 Subject: [PATCH 3/3] lint --- ui/app/peers/[peerName]/lagGraph.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/app/peers/[peerName]/lagGraph.tsx b/ui/app/peers/[peerName]/lagGraph.tsx index 3afe75d4b..d971bee8f 100644 --- a/ui/app/peers/[peerName]/lagGraph.tsx +++ b/ui/app/peers/[peerName]/lagGraph.tsx @@ -24,9 +24,7 @@ function parseLSN(lsn: string): number { const parsedLsn1 = parseInt(lsn1, 16); const parsedLsn2 = parseInt(lsn2, 16); if (isNaN(parsedLsn1) || isNaN(parsedLsn2)) return 0; - return Number( - (BigInt(parsedLsn1) << BigInt(32)) | BigInt(parsedLsn2) - ); + return Number((BigInt(parsedLsn1) << BigInt(32)) | BigInt(parsedLsn2)); } export default function LagGraph({ peerName }: LagGraphProps) {