Skip to content

Add go remote debugging support in TILT#4216

Merged
masterashu merged 7 commits into
mainfrom
add-vscode-remote-go-debugger-in-tilt
May 8, 2026
Merged

Add go remote debugging support in TILT#4216
masterashu merged 7 commits into
mainfrom
add-vscode-remote-go-debugger-in-tilt

Conversation

@masterashu

@masterashu masterashu commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes:

  • Added go compiler flags to flow build command in flow.dockerfile (disabled optimizations, recommended for debugging)
  • Added a new stage in flow.dockerfile with dlv (delve debugger) entrypoint which exposes endpoint to attach debugger to and updated the same in Tiltfile
  • VSCode launch config which attaches the debugger and resolved breakpoints etc.

@codecov

codecov Bot commented Apr 22, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2208 2 2206 189
View the top 3 failed test(s) by shortest run time
github.com/PeerDB-io/peerdb/flow/e2e::TestApiPg
Stack Traces | 0.01s run time
=== RUN   TestApiPg
=== PAUSE TestApiPg
=== CONT  TestApiPg
--- FAIL: TestApiPg (0.01s)
github.com/PeerDB-io/peerdb/flow/e2e::TestPeerFlowE2ETestSuitePG_CH
Stack Traces | 0.01s run time
=== RUN   TestPeerFlowE2ETestSuitePG_CH
=== PAUSE TestPeerFlowE2ETestSuitePG_CH
=== CONT  TestPeerFlowE2ETestSuitePG_CH
--- FAIL: TestPeerFlowE2ETestSuitePG_CH (0.01s)
2026/05/05 16:02:52 INFO Received AWS credentials from peer for connector: ci x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN}
2026/05/05 16:02:52 INFO Received AWS credentials from peer for connector: clickhouse x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN}
github.com/PeerDB-io/peerdb/flow/e2e::TestApiPg/TestCancelTableAddition_WithRemoval
Stack Traces | 23.2s run time
=== RUN   TestApiPg/TestCancelTableAddition_WithRemoval
=== PAUSE TestApiPg/TestCancelTableAddition_WithRemoval
=== CONT  TestApiPg/TestCancelTableAddition_WithRemoval
2026/05/05 16:00:24 INFO fetched schema x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} table=e2e_test_mychcl_aelhfavi.test_exclude_ch
2026/05/05 16:00:24 INFO fetched schema x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} table=e2e_test_mychg_s0eggidg.test_simple_schema_changes
2026/05/05 16:00:24 INFO Received AWS credentials from peer for connector: ci x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN}
2026/05/05 16:00:24 INFO Received AWS credentials from peer for connector: clickhouse x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN}
    cancel_table_addition_test.go:361: WaitFor wait for initial load to finish 2026-05-05 16:00:33.0050742 +0000 UTC m=+433.489458664
    cancel_table_addition_test.go:365: WaitFor t1 initial load 2026-05-05 16:00:33.005553692 +0000 UTC m=+433.489938156
2026/05/05 16:00:33 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t1\" ORDER BY id"
2026/05/05 16:00:33 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t1\" ORDER BY id"
2026/05/05 16:00:33 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_15232620787182876658 CURSOR FOR SELECT id,val FROM e2e_test_api_6ekeenly.\"t1\" ORDER BY id" args=[]
2026/05/05 16:00:33 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t1\" ORDER BY id" channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_15232620787182876658
2026/05/05 16:00:33 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_15232620787182876658 records=1 bytes=9 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t1\" ORDER BY id" rows=1 bytes=9 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_15232620787182876658
2026/05/05 16:00:33 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_15232620787182876658 records=0 bytes=0 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t1\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/05 16:00:33 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t1\" ORDER BY id" rows=1 bytes=9 channelLen=0
    cancel_table_addition_test.go:366: WaitFor t2 initial load 2026-05-05 16:00:33.018987846 +0000 UTC m=+433.503372310
2026/05/05 16:00:33 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t2\" ORDER BY id"
2026/05/05 16:00:33 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t2\" ORDER BY id"
2026/05/05 16:00:33 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_1622589679164585499 CURSOR FOR SELECT id,val FROM e2e_test_api_6ekeenly.\"t2\" ORDER BY id" args=[]
2026/05/05 16:00:33 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t2\" ORDER BY id" channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1622589679164585499
2026/05/05 16:00:33 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1622589679164585499 records=1 bytes=9 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t2\" ORDER BY id" rows=1 bytes=9 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1622589679164585499
2026/05/05 16:00:33 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_1622589679164585499 records=0 bytes=0 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t2\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/05 16:00:33 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t2\" ORDER BY id" rows=1 bytes=9 channelLen=0
    cancel_table_addition_test.go:367: WaitFor t3 initial load 2026-05-05 16:00:33.024559961 +0000 UTC m=+433.508944425
2026/05/05 16:00:33 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t3\" ORDER BY id"
2026/05/05 16:00:33 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t3\" ORDER BY id"
2026/05/05 16:00:33 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_711830992068237530 CURSOR FOR SELECT id,val FROM e2e_test_api_6ekeenly.\"t3\" ORDER BY id" args=[]
2026/05/05 16:00:33 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t3\" ORDER BY id" channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_711830992068237530
2026/05/05 16:00:33 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_711830992068237530 records=1 bytes=9 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t3\" ORDER BY id" rows=1 bytes=9 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_711830992068237530
2026/05/05 16:00:33 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_711830992068237530 records=0 bytes=0 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t3\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/05 16:00:33 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/05 16:00:33 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,val FROM e2e_test_api_6ekeenly.\"t3\" ORDER BY id" rows=1 bytes=9 channelLen=0
    cancel_table_addition_test.go:375: WaitFor wait for pause for add table 2026-05-05 16:00:33.033986019 +0000 UTC m=+433.518370473
    cancel_table_addition_test.go:376: UNEXPECTED ERROR unable to establish connection with catalog: FATAL: terminating connection due to administrator command (SQLSTATE 57P01)
    api_test.go:49: begin tearing down postgres schema api_6ekeenly
--- FAIL: TestApiPg/TestCancelTableAddition_WithRemoval (23.22s)
github.com/PeerDB-io/peerdb/flow/e2e::TestPeerFlowE2ETestSuitePG_CH/Test_Binary_Format_Base64
Stack Traces | 138s run time
=== RUN   TestPeerFlowE2ETestSuitePG_CH/Test_Binary_Format_Base64
=== PAUSE TestPeerFlowE2ETestSuitePG_CH/Test_Binary_Format_Base64
=== CONT  TestPeerFlowE2ETestSuitePG_CH/Test_Binary_Format_Base64
2026/05/05 16:00:34 INFO Received AWS credentials from peer for connector: ci x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN}
2026/05/05 16:00:34 INFO Received AWS credentials from peer for connector: clickhouse x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN}
    clickhouse_test.go:1064: WaitFor waiting for CDC count 2026-05-05 16:00:38.605971762 +0000 UTC m=+418.403176596
    clickhouse_test.go:1068: WaitFor waiting for CDC count 2026-05-05 16:00:38.611699358 +0000 UTC m=+418.408904202
    clickhouse.go:97: 
        	Error Trace:	.../flow/e2e/congen.go:44
        	            				.../flow/e2e/clickhouse.go:97
        	            				.../flow/e2e/clickhouse.go:79
        	            				.../flow/e2e/clickhouse.go:154
        	            				.../flow/e2e/test_utils.go:240
        	            				.../flow/e2e/test_utils.go:852
        	            				.../flow/e2e/test_utils.go:237
        	            				.../flow/e2e/clickhouse_test.go:1068
        	            				.../flow/e2e/clickhouse_test.go:1091
        	Error:      	Received unexpected error:
        	            	unable to establish connection with catalog: FATAL: terminating connection due to administrator command (SQLSTATE 57P01)
        	Test:       	TestPeerFlowE2ETestSuitePG_CH/Test_Binary_Format_Base64
    clickhouse.go:107: begin tearing down postgres schema pgch_b6ivua85
2026/05/05 16:00:52 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,\"key\" FROM e2e_test_pgch_4oygf71r.\"test_nullengine\" ORDER BY id"
2026/05/05 16:00:52 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,\"key\" FROM e2e_test_pgch_4oygf71r.\"test_nullengine\" ORDER BY id"
2026/05/05 16:00:52 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursorQuery="DECLARE peerdb_cursor_15432887432884835708 CURSOR FOR SELECT id,\"key\" FROM e2e_test_pgch_4oygf71r.\"test_nullengine\" ORDER BY id" args=[]
2026/05/05 16:00:52 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,\"key\" FROM e2e_test_pgch_4oygf71r.\"test_nullengine\" ORDER BY id" channelLen=0
2026/05/05 16:00:52 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_15432887432884835708
2026/05/05 16:00:52 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_15432887432884835708 records=3 bytes=26 channelLen=2
2026/05/05 16:00:52 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,\"key\" FROM e2e_test_pgch_4oygf71r.\"test_nullengine\" ORDER BY id" rows=3 bytes=26 channelLen=2
2026/05/05 16:00:52 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_15432887432884835708
2026/05/05 16:00:52 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart cursor=peerdb_cursor_15432887432884835708 records=0 bytes=0 channelLen=0
2026/05/05 16:00:52 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,\"key\" FROM e2e_test_pgch_4oygf71r.\"test_nullengine\" ORDER BY id" rows=0 bytes=0 channelLen=0
2026/05/05 16:00:52 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart
2026/05/05 16:00:52 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId=testpart query="SELECT id,\"key\" FROM e2e_test_pgch_4oygf71r.\"test_nullengine\" ORDER BY id" rows=3 bytes=26 channelLen=0
    clickhouse.go:107: 
        	Error Trace:	.../flow/e2e/pg.go:147
        	            				.../flow/e2e/clickhouse.go:107
        	            				.../flow/e2eshared/e2eshared.go:38
        	            				.../hostedtoolcache/go/1.26.2.../src/testing/testing.go:1317
        	            				.../hostedtoolcache/go/1.26.2.../src/testing/testing.go:1667
        	            				.../hostedtoolcache/go/1.26.2.../src/testing/testing.go:2030
        	            				.../hostedtoolcache/go/1.26.2.../src/runtime/panic.go:694
        	            				.../hostedtoolcache/go/1.26.2.../src/testing/testing.go:1022
        	            				.../flow/e2e/congen.go:44
        	            				.../flow/e2e/clickhouse.go:97
        	            				.../flow/e2e/clickhouse.go:79
        	            				.../flow/e2e/clickhouse.go:154
        	            				.../flow/e2e/test_utils.go:240
        	            				.../flow/e2e/test_utils.go:852
        	            				.../flow/e2e/test_utils.go:237
        	            				.../flow/e2e/clickhouse_test.go:1068
        	            				.../flow/e2e/clickhouse_test.go:1091
        	Error:      	failed to teardown postgres schema
        	Test:       	TestPeerFlowE2ETestSuitePG_CH/Test_Binary_Format_Base64
        	Messages:   	pgch_b6ivua85: failed to drop replication slots: ERROR: replication slot "peerflow_slot_ch_binary_format_base64_pgch_b6ivua85" is active for PID 18868 (SQLSTATE 55006)
--- FAIL: TestPeerFlowE2ETestSuitePG_CH/Test_Binary_Format_Base64 (138.37s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: The test failed due to a PostgreSQL SQLSTATE 57P01 (admin_shutdown) error — the catalog DB connection was killed by an external administrator command mid-test, a transient CI infrastructure issue unrelated to any code change.
Confidence: 0.95

✅ Automatically retrying the workflow

View workflow run

@pfcoperez pfcoperez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic!
Tbh, I think this opens the doors for debugging beyond "just" vs code. For example, we can add the instructions to attach the debugger at https://github.com/PeerDB-io/peerdb/blob/main/.claude/skills/skills/local-debug/SKILL.md . This way we'd close the loop on automatic debugging which so far was limited to test code

Comment thread stacks/flow.Dockerfile Outdated
ENV GOCACHE=/root/.cache/go-build
RUN --mount=type=cache,target="/root/.cache/go-build" go build -o /root/peer-flow
RUN --mount=type=cache,target="/root/.cache/go-build" go build ${DEBUG_BUILD:+-gcflags} ${DEBUG_BUILD:+"all=-N -l"} -o /root/peer-flow
RUN --mount=type=cache,target="/root/.cache/go-build" go install github.com/go-delve/delve/cmd/dlv@latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't executing this command be conditioned on DEBUG_BUILD too?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@masterashu you added a 👍 to this comment but the command still runs unconditionally, did you forget to add that or you think we can skip?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, i was thinking of moving this in the flow-base-debug stage, but its better to have it in build stage itself, added a condition now.

Comment thread stacks/flow.Dockerfile Outdated
COPY --from=builder /go/bin/dlv /usr/local/bin/dlv
USER peerdb
EXPOSE 40000
ENTRYPOINT ["dlv", "--headless", "--continue", "--accept-multiclient", "--listen=:40000", "--api-version=2", "exec", "./peer-flow", "--", "worker"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Would it make sense to make the hard-coded port number '40000' configurable through an env var?

Comment thread docker-compose-dev.yml Outdated
dockerfile: stacks/flow.Dockerfile
target: flow-worker
ports:
- 40000:40000

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about the port being hard coded.

Comment thread stacks/flow.Dockerfile Outdated
ENTRYPOINT ["./peer-flow", "snapshot-worker"]


FROM flow-base AS flow-worker-debug

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if the CI steps building and pushing images can inadvertently get added a new image to build. I tend to think that's not the case because CI steps building images such us customer-docker.yml use https://github.com/PeerDB-io/peerdb/blob/main/docker-bake.hcl .

flow-worker-debug is not in that build definition file so, by default, we are not going to build it.

If you can confirm, this is a no-comment. Otherwise, we might want to move flow-worker-debug and other future debug images to a separate Dockerfile.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it won't happen unless we want to build & publish debug images

Comment thread Tiltfile

flow_ignore = ['flow/e2e/', 'flow/**/*_test.go']

docker_build('flow-api', '.',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to stop at flow-worker-debug? Why not including flow-api and others too? Is it because you want to start with one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added for flow-snapshot worker and flow-api as well,

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: Both failing runs hit a transient PostgreSQL catalog connection termination (SQLSTATE 57P01 — "terminating connection due to administrator command") mid-test in TestCancelAddCancel, an infrastructure error unrelated to code correctness.
Confidence: 0.92

✅ Automatically retrying the workflow

View workflow run

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: TestApiPg/TestQRep failed with PostgreSQL SQLSTATE 57P01 (admin_shutdown) — a transient catalog DB connection termination during the CI run, not a code regression.
Confidence: 0.95

✅ Automatically retrying the workflow

View workflow run

@masterashu

masterashu commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@pfcoperez For now, changed the ports in docker-compose for now. seeing how to make it dynamic based on env, also refactored dockerfile and added the debug for flow-api and flow-snapshot worker

@masterashu masterashu force-pushed the add-vscode-remote-go-debugger-in-tilt branch from 8d722c6 to 0feb42f Compare May 4, 2026 12:44
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: TestCancelTableAdditionRemoveAddRemove failed due to a transient PostgreSQL connection drop (SQLSTATE 57P01 - admin_shutdown), where the catalog connection was terminated by an administrator command mid-test rather than any code regression.
Confidence: 0.9

✅ Automatically retrying the workflow

View workflow run

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: The e2e test Test_Binary_Format_Base64 failed with PostgreSQL SQLSTATE 57P01 ("terminating connection due to administrator command"), an infrastructure-level connection kill unrelated to test logic, indicating a flaky CI environment failure rather than a code regression.
Confidence: 0.93

✅ Automatically retrying the workflow

View workflow run

Comment thread Tiltfile Outdated
docker_build('flow-worker', '.',
dockerfile='stacks/flow.Dockerfile',
target='flow-worker',
target='flow-worker-debug' if resolve_env('DOCKER_GO_DEBUG_FLOW_WORKER') == '1' else 'flow-worker',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely, someone will try to use value true just from pure inertia. I think we can protect a bit by allowing 1 or true .

Comment thread stacks/flow.Dockerfile Outdated
ENV GOCACHE=/root/.cache/go-build
RUN --mount=type=cache,target="/root/.cache/go-build" go build -o /root/peer-flow
RUN --mount=type=cache,target="/root/.cache/go-build" go build ${DEBUG_BUILD:+-gcflags} ${DEBUG_BUILD:+"all=-N -l"} -o /root/peer-flow
RUN --mount=type=cache,target="/root/.cache/go-build" go install github.com/go-delve/delve/cmd/dlv@latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@masterashu you added a 👍 to this comment but the command still runs unconditionally, did you forget to add that or you think we can skip?

@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

🔄 Flaky Test Detected

Analysis: Both failing tests (TestCancelTableAddition_WithRemoval and Test_Binary_Format_Base64) crashed due to FATAL: terminating connection due to administrator command (SQLSTATE 57P01) — a PostgreSQL connection terminated at the infrastructure level, not a code assertion failure.
Confidence: 0.92

✅ Automatically retrying the workflow

View workflow run

@masterashu masterashu self-assigned this May 6, 2026
…le instances of tilt for peerdb

Co-authored-by: Copilot <copilot@github.com>
@masterashu

Copy link
Copy Markdown
Contributor Author

hey @pfcoperez made some improvements.

@masterashu masterashu marked this pull request as ready for review May 6, 2026 11:43
@claude

claude Bot commented May 6, 2026

Copy link
Copy Markdown

test

@claude

claude Bot commented May 6, 2026

Copy link
Copy Markdown

Code Review

Two issues found. Checked for bugs and CLAUDE.md compliance.


Issue 1: Tiltfile/Dockerfile mismatch causes build failure when DEBUG_BUILD=true

File: stacks/flow.Dockerfile (lines 29-31)

The Tiltfile accepts both '1' and 'true' for debug env vars and passes the raw value as DEBUG_BUILD to Docker via build_args. However, the Dockerfile condition on line 29 only checks for "1":

if [[ "$DEBUG_BUILD" = "1" ]]; then

When a user sets DOCKER_GO_DEBUG_FLOW_API=true, the Tiltfile selects the -debug target, but the Dockerfile does not install Delve. The subsequent COPY --from=builder /go/bin/dlv in flow-base-debug (line 46) then fails because the file does not exist.

Note that the parameter expansion on line 28 already handles any non-empty value correctly. Suggested fix: change to if [ -n "$DEBUG_BUILD" ]; then to be consistent.


Issue 2: Unrelated volume mount path change may break existing dev environments

File: docker-compose-dev.yml (line 73)

The catalog volume mount was changed from pgdata:/var/lib/postgresql/data to pgdata:/var/lib/postgresql. This change appears unrelated to the debug support work in this PR. For developers with an existing pgdata Docker volume, PostgreSQL will see an empty data/ subdirectory at the new mount point and reinitialize from scratch, making existing catalog data inaccessible. This is also inconsistent with the production docker-compose.yml which still uses /var/lib/postgresql/data.

Was this change intentional?

@masterashu masterashu requested a review from a team as a code owner May 8, 2026 08:45
@masterashu masterashu merged commit ded6df1 into main May 8, 2026
13 checks passed
@masterashu masterashu deleted the add-vscode-remote-go-debugger-in-tilt branch May 8, 2026 13:03
pfcoperez added a commit that referenced this pull request May 14, 2026
…4306)

In #4216, we exposed Go debug
port for services in local dev-env.

The sample `.env.example` ports for these were carefully chosen so they
wouldn't collide with ClickHouse internal testing tooling:


https://github.com/PeerDB-io/peerdb/blob/1bce75b767bfd293e18f3a4c671c75090fce7651/.env.example#L69-L71

But the fallback ports in Tiltfile didn't fall into the same range. This
PR fixes the fallback ports.
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