Skip to content

Commit 1614504

Browse files
committed
fix: move servicelinks and communities passes before dump
The passes were running after run_post_extraction() which includes dump_and_persist_hashes(), causing a NULL hash table SEGV when the GraphQL linker called cbm_gbuf_find_by_label on the already-dumped graph buffer. Now runs inside run_post_extraction(): after tests+githistory, before predump passes and dump — where the graph buffer is still fully live. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent de7801a commit 1614504

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

src/pipeline/pipeline.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,27 @@ static int run_post_extraction(cbm_pipeline_t *p, cbm_pipeline_ctx_t *ctx,
740740
return rc;
741741
}
742742

743+
/* Cross-service protocol linking (GraphQL, gRPC, Kafka, etc.) */
744+
if (!check_cancel(p)) {
745+
struct timespec t;
746+
cbm_clock_gettime(CLOCK_MONOTONIC, &t);
747+
int sl_rc = cbm_pipeline_pass_servicelinks(ctx);
748+
if (sl_rc < 0) {
749+
cbm_log_warn("pass.servicelinks.error", "rc", itoa_buf(sl_rc));
750+
}
751+
cbm_log_info("pass.timing", "pass", "servicelinks", "elapsed_ms",
752+
itoa_buf((int)elapsed_ms(t)));
753+
}
754+
755+
/* Communities pass (Louvain clustering on service-link edges) */
756+
if (!check_cancel(p)) {
757+
struct timespec t;
758+
cbm_clock_gettime(CLOCK_MONOTONIC, &t);
759+
cbm_pipeline_pass_communities(ctx);
760+
cbm_log_info("pass.timing", "pass", "communities", "elapsed_ms",
761+
itoa_buf((int)elapsed_ms(t)));
762+
}
763+
743764
CBM_PROF_START(t_predump);
744765
run_predump_passes(p, ctx);
745766
CBM_PROF_END("pipeline", "3_predump_passes_total", t_predump);
@@ -848,27 +869,6 @@ int cbm_pipeline_run(cbm_pipeline_t *p) {
848869
goto cleanup;
849870
}
850871

851-
/* Cross-service protocol linking (GraphQL, gRPC, Kafka, etc.) */
852-
if (!check_cancel(p)) {
853-
struct timespec t;
854-
cbm_clock_gettime(CLOCK_MONOTONIC, &t);
855-
int sl_rc = cbm_pipeline_pass_servicelinks(&ctx);
856-
if (sl_rc < 0) {
857-
cbm_log_warn("pass.servicelinks.error", "rc", itoa_buf(sl_rc));
858-
}
859-
cbm_log_info("pass.timing", "pass", "servicelinks", "elapsed_ms",
860-
itoa_buf((int)elapsed_ms(t)));
861-
}
862-
863-
/* Communities pass (Louvain clustering on service-link edges) */
864-
if (!check_cancel(p)) {
865-
struct timespec t;
866-
cbm_clock_gettime(CLOCK_MONOTONIC, &t);
867-
cbm_pipeline_pass_communities(&ctx);
868-
cbm_log_info("pass.timing", "pass", "communities", "elapsed_ms",
869-
itoa_buf((int)elapsed_ms(t)));
870-
}
871-
872872

873873
cbm_log_info("pipeline.done", "nodes", itoa_buf(cbm_gbuf_node_count(p->gbuf)), "edges",
874874
itoa_buf(cbm_gbuf_edge_count(p->gbuf)), "elapsed_ms",

0 commit comments

Comments
 (0)