[Bug] JDBC trace profiling query fails with SQL syntax error when the segment list is empty
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- backend-api-design, databases
Línea de trabajo
Empieza por JDBCTraceQueryDAO.queryBySegmentIdList en la traza de pila y sigue cómo ProfileTaskQueryService.getTaskSegments pasa los IDs de segmento. Revisa las pruebas del JDBC DAO para encontrar dónde añadir un caso de regresión con una colección vacía. La tarea estará terminada cuando una tarea sin segmentos muestreados devuelva una lista vacía sin generar SQL no válido.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Search before asking
- I had searched in the issues and found no similar issues.
Apache SkyWalking Component
OAP server (apache/skywalking)
What happened
Opening trace profiling results for a task with no collected calls fails with a MariaDB SQL syntax error at GraphQL /segmentList. Locally, the failure occurs when there are no collected calls.
Environment
- OAP image: apache/skywalking-oap-server:11.1.0
- Horizon image: ghcr.io/apache/skywalking-horizon-ui:1.1.0
- Storage: MariaDB, SW_STORAGE=mysql
- MySQL Connector/J: 8.4.0
What you expected to happen
A profiling task with no sampled segments should return an empty list, allowing the UI to display no data, without executing invalid SQL.
How to reproduce
- Run OAP with JDBC/MySQL storage backed by MariaDB.
- Create a trace profiling task for an instrumented service.
- Do not generate matching calls / collected profiling segments.
- Open the task segment list in Horizon Trace Profiling (GraphQL getProfileTaskSegments).
- Observe the SQLSyntaxErrorException at /segmentList.
Anything else
Observed OAP stack trace
Exception while fetching data (/segmentList): java.sql.SQLSyntaxErrorException:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version
for the right syntax to use near ')' at line 1
at org.apache.skywalking.oap.server.library.client.jdbc.hikaricp.JDBCClient.executeQuery(JDBCClient.java:118)
at org.apache.skywalking.oap.server.storage.plugin.jdbc.common.dao.JDBCTraceQueryDAO.queryBySegmentIdList(JDBCTraceQueryDAO.java:265)
at org.apache.skywalking.oap.server.core.profiling.trace.ProfileTaskQueryService.getTaskSegments(ProfileTaskQueryService.java:202)
at org.apache.skywalking.oap.server.core.profiling.trace.ProfileTaskQueryService.getProfileTaskSegments(ProfileTaskQueryService.java:207)
at org.apache.skywalking.oap.query.graphql.resolver.ProfileQuery.lambda$getProfileTaskSegments$2(ProfileQuery.java:66)
Suspected cause: an empty segment ID collection reaches queryBySegmentIdList and produces an empty IN () predicate. The full generated SQL was not captured, so this SQL shape is an inference from the trigger and stack trace. Please check empty-list handling and add an empty-collection regression test.
Searched existing issues for segmentList + syntax and queryBySegmentIdList + empty. #14172 concerns profiling records disappearing with BanyanDB; this report concerns a JDBC/MariaDB syntax error. No local OAP code modification has been applied.
Are you willing to submit a pull request to fix on your own?
- Yes I am willing to submit a pull request on my own!
Code of Conduct
- I agree to follow this project's Code of Conduct
- Lenguaje dominante
- Java
- Estrellas
- 25k
- Forks
- 6.6k
- Merge medio
- 12 h 1 min
- PR fusionados (30 d)
- 43
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 apache/skywalking
-
AI Assistant database enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 24/100
apache/skywalking#14237 ·
Los mantenedores suelen responder en 1 día
-
database enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
apache/skywalking#14236 ·
Los mantenedores suelen responder en 1 día
-
AI Assistant database enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
apache/skywalking#14235 ·
Los mantenedores suelen responder en 1 día
-
database enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
apache/skywalking#14234 ·
Los mantenedores suelen responder en 1 día
-
database enhancement query tracing
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
apache/skywalking#14233 ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/skywalking
Issues similares
-
Re-executed query with IN condition on an index column returns deleted rows (stale IndexCursor)Posiblemente ocupada @dbusche la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
h2database/h2database#4580 ·
Los mantenedores suelen responder en 1 día
-
vips-drift
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Stirling-Tools/JPDFium#300 ·
Los mantenedores suelen responder en 1 día
-
hermes-queue
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
chrisalunlloyd2-sudo/mindpalace#403 ·
Los mantenedores suelen responder en 1 día
-
Guidelines: document how to build a use case against a local, unpublished Flow/browserless-test changePosiblemente ocupada @totally-not-ai la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
vaadin/use-cases#452 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area/storage area/storage/sql
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Apicurio/apicurio-registry#11159 ·
Los mantenedores suelen responder en 1 día