Go/sarama: consumer group ID is recorded as a Kafka topic (false ASYNC_CALLS), and real topics from ProducerMessage{Topic} / ConsumerGroup.Consume are not extracted
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
Línea de trabajo
Start with internal/cbm/extract_calls.c, especially is_queue_topic_field() and extract_composite_queue_field(), then trace how calls are classified when the callee cannot be resolved. Reproduce with the attached repro.sh.txt, section "Issue 3". Done means the producer and consumer each emit ASYNC_CALLS for payments.charged, the group ID emits no edge, and cross_async_calls is 1.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
Version: 0.11.0 (release). Also reproduced on main @ 96c3f41c built from source.
Platform
Linux (x64)
Install channel
GitHub release archive / install.sh / install.ps1
Binary variant
standard
What happened, and what did you expect?
For an idiomatic sarama producer and consumer of the same topic, in two repositories:
- False edge. In the consumer,
sarama.NewConsumerGroup(brokers, "ledger-group", cfg)
producesASYNC_CALLS main -> ledger-groupwith
{"callee":"sarama.NewConsumerGroup","url_path":"ledger-group","broker":"kafka"}.
"ledger-group"is the consumer group ID, not a topic. - Missed consumer topic.
g.Consume(ctx, []string{"payments.charged"}, h)produces no
ASYNC_CALLS edge forpayments.charged. - Missed producer topic.
p.SendMessage(&sarama.ProducerMessage{Topic: "payments.charged", ...})
produces no ASYNC_CALLS edge.
Result: cross_async_calls: 0 between producer and consumer. Before investigating, we
had read edge 1 as "consumer detected", which is how the false edge can mislead users.
Expected: producer ASYNC_CALLS to topic payments.charged, consumer ASYNC_CALLS to topic
payments.charged, no edge for the group ID, and one CROSS_ASYNC_CALLS between the
repos.
Reproduction
- Code:
// producer/main.go (go.mod requires github.com/IBM/sarama)
package main
import "github.com/IBM/sarama"
func publishCharged(p sarama.SyncProducer) error {
_, _, err := p.SendMessage(&sarama.ProducerMessage{Topic: "payments.charged", Value: sarama.StringEncoder("{}")})
return err
}
func main() {
p, _ := sarama.NewSyncProducer([]string{"kafka:9092"}, nil)
_ = publishCharged(p)
}
// consumer/main.go
package main
import (
"context"
"github.com/IBM/sarama"
)
type handler struct{}
func (handler) Setup(sarama.ConsumerGroupSession) error { return nil }
func (handler) Cleanup(sarama.ConsumerGroupSession) error { return nil }
func (handler) ConsumeClaim(s sarama.ConsumerGroupSession, c sarama.ConsumerGroupClaim) error {
for range c.Messages() {
}
return nil
}
func consumeCharged(g sarama.ConsumerGroup) error {
return g.Consume(context.Background(), []string{"payments.charged"}, handler{})
}
func main() {
g, _ := sarama.NewConsumerGroup([]string{"kafka:9092"}, "ledger-group", nil)
_ = consumeCharged(g)
}
- Commands:
codebase-memory-mcp cli query_graph '{"project":"<consumer>","query":"MATCH (a)-[r:ASYNC_CALLS]->(b) RETURN a.name, b.name, r"}'
codebase-memory-mcp cli get_graph_schema '{"project":"<producer>"}'
codebase-memory-mcp cli index_repository '{"repo_path":"/path/to/producer","name":"<producer>","mode":"cross-repo-intelligence","target_projects":["<consumer>"]}'
- Output: the consumer has one row,
main ledger-group {"callee":"sarama.NewConsumerGroup","url_path":"ledger-group",...};
the producer has no ASYNC_CALLS; andcross_async_calls: 0.
Attached repro.sh, section "Issue 3".
What we observed while debugging (instrumented build of 96c3f41c)
- The extracted
first_string_argvalues were:sarama.NewConsumerGroup->"ledger-group", the first string literal among the
arguments, which is the group ID;g.Consume-> none (the topic is inside a[]string{...}literal);p.SendMessage-> none (the topic is a struct field).
extract_composite_queue_field()already recovers topics from composite literals, but
is_queue_topic_field()(internal/cbm/extract_calls.c:2244) only accepts
QueueUrl/QueueURL/TopicArn/TopicARN/QueueName/TopicName/QueueArn/QueueARN/Destination.
It does not acceptTopic, which is the field used by saramaProducerMessage, kafka-go
Message/Writer/ReaderConfig, franz-gokgo.Recordand confluentTopicPartition.
AddingTopicalone madefirst_string_argbecomepayments.charged. The edge was
still not emitted, becausep.SendMessage(a method on a sarama-typed variable)
resolves to nothing and its callee text does not contain a service-pattern keyword.
This looks like the same external-package classification limit as the separate
net/httpreport.sarama.NewConsumerGroup/NewConsumerGroupFromClienttake a group ID, not a topic.
Excluding them, or reading topics fromConsume's[]stringargument instead, would
remove the false edge.
Full self-contained script (creates throwaway repos in a temp dir, isolated cache): see attached repro.sh.txt, section "Issue N". Run with bash repro.sh.txt
Logs
"== Issue 3: Go sarama topics not extracted; consumer group ID recorded as a topic"
repo i3-producer go.mod <<<'module example.com/producer
go 1.22
require github.com/IBM/sarama v1.45.0'
repo i3-producer main.go <<'GO'
package main
import "github.com/IBM/sarama"
func publishCharged(p sarama.SyncProducer) error {
_, _, err := p.SendMessage(&sarama.ProducerMessage{Topic: "payments.charged", Value: sarama.StringEncoder("{}")})
return err
}
func main() {
p, _ := sarama.NewSyncProducer([]string{"kafka:9092"}, nil)
_ = publishCharged(p)
}
GO
repo i3-consumer go.mod <<<'module example.com/consumer
go 1.22
require github.com/IBM/sarama v1.45.0'
repo i3-consumer main.go <<'GO'
package main
import (
"context"
"github.com/IBM/sarama"
)
type handler struct{}
func (handler) Setup(sarama.ConsumerGroupSession) error { return nil }
func (handler) Cleanup(sarama.ConsumerGroupSession) error { return nil }
func (handler) ConsumeClaim(s sarama.ConsumerGroupSession, c sarama.ConsumerGroupClaim) error {
for range c.Messages() {
}
return nil
}
func consumeCharged(g sarama.ConsumerGroup) error {
return g.Consume(context.Background(), []string{"payments.charged"}, handler{})
}
func main() {
g, _ := sarama.NewConsumerGroup([]string{"kafka:9092"}, "ledger-group", nil)
_ = consumeCharged(g)
}
GO
commit i3-producer; commit i3-consumer; index i3-producer; index i3-consumer
check "ASYNC_CALLS in producer (topic payments.charged)" "$(count i3-producer ASYNC_CALLS)" 1
echo " consumer ASYNC_CALLS edges (expected: one to topic payments.charged, none to the group ID):"
rows i3-consumer 'MATCH (a)-[r:ASYNC_CALLS]->(b) RETURN a.name, b.name, r' | sed 's/^/ /'
check "CROSS_ASYNC_CALLS producer -> consumer" "$(cross i3-producer i3-consumer cross_async_calls)" 1
Diagnostics trajectory (memory / performance / leak issues)
Project scale (if relevant)
No response
Confirmations
- I searched existing issues and this is not a duplicate.
- My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.
- Lenguaje dominante
- C
- Estrellas
- 45.8k
- Forks
- 3.8k
- Merge medio
- 3 d 6 h
- PR fusionados (30 d)
- 201
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DeusData/codebase-memory-mcp
-
Generated Pi extension (cbmem.ts) breaks Gemini/Antigravity: Type.Union of Type.Literal serializes to anyOf/constPosiblemente ocupada @divakantpandey la tomó hace 1 día. Abiertobug editor/integration
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DeusData/codebase-memory-mcp#2787 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
editor/integration parsing/quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DeusData/codebase-memory-mcp#2286 ·
Los mantenedores suelen responder en 2 días
-
install writes an unsupported `args` key into the Claude Code SubagentStart hook, so it never runsAbiertobug editor/integration priority/high stability/performance ux/behavior
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DeusData/codebase-memory-mcp#2239 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
bug priority/high ux/behavior
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DeusData/codebase-memory-mcp#2232 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
documentation editor/integration parsing/quality priority/normal
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
DeusData/codebase-memory-mcp#2169 ·
Los mantenedores suelen responder en 2 días
Todos los issues de DeusData/codebase-memory-mcp
Issues similares
-
[CLI] Clarify distinction between 'capture camera' and 'capture screen' in help text and outputAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
espressif/esp-vision#18 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
HexaCluster/credcheck#94 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
JS_SetPropertyInternal2 loses the value when a lazy property on the prototype runs out of memoryAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quickjs-ng/quickjs#1852 ·
Los mantenedores suelen responder en 2 días