Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

KILL fails with err message "closed network connection" #635

@carlosms

Description

@carlosms

Testing with v0.19.0-rc2.

$ go run cmd/srcd/main.go sql "SHOW PROCESSLIST"
+-----+------+---------------------+---------+---------+------+--------------------------------+--------------------------------+
| ID  | USER |        HOST         |   DB    | COMMAND | TIME |             STATE              |              INFO              |
+-----+------+---------------------+---------+---------+------+--------------------------------+--------------------------------+
|  49 | root | 192.168.160.2:43598 | gitbase | query   |  440 | SquashedTable(refs,            | /* Files named main.go in HEAD |
|     |      |                     |         |         |      | commit_files, files)(635/696)  | */                             |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                | SELECT f.repository_id,        |
|     |      |                     |         |         |      |                                | f.file_path,                   |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                |        LANGUAGE(f.file_path,   |
|     |      |                     |         |         |      |                                | f.blob_content) AS lang,       |
|     |      |                     |         |         |      |                                | f.blob_content,                |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                |        UAST(f.blob_content,    |
|     |      |                     |         |         |      |                                | LANGUAGE(f.file_path,          |
|     |      |                     |         |         |      |                                | f.blob_content)) AS uast       |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                | FROM   refs AS r               |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                |        NATURAL JOIN            |
|     |      |                     |         |         |      |                                | commit_files                   |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                |        NATURAL JOIN files AS f |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                | WHERE  r.ref_name = 'HEAD'     |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                |        AND f.file_path         |
|     |      |                     |         |         |      |                                | REGEXP('.*main.go')            |
|  87 | root | 192.168.160.2:43598 | gitbase | query   |  383 | SquashedTable(refs,            | /* Files named main.go in HEAD |
|     |      |                     |         |         |      | commit_files, files)(659/696)  | */                             |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                | SELECT f.repository_id,        |
|     |      |                     |         |         |      |                                | f.file_path,                   |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                |        LANGUAGE(f.file_path,   |
|     |      |                     |         |         |      |                                | f.blob_content) AS lang,       |
|     |      |                     |         |         |      |                                | f.blob_content,                |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                |        UAST(f.blob_content,    |
|     |      |                     |         |         |      |                                | LANGUAGE(f.file_path,          |
|     |      |                     |         |         |      |                                | f.blob_content)) AS uast       |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                | FROM   refs AS r               |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                |        NATURAL JOIN            |
|     |      |                     |         |         |      |                                | commit_files                   |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                |        NATURAL JOIN files AS f |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                | WHERE  r.ref_name = 'HEAD'     |
|     |      |                     |         |         |      |                                |                                |
|     |      |                     |         |         |      |                                |        AND f.file_path         |
|     |      |                     |         |         |      |                                | REGEXP('.*main.go')            |
| 268 | root | 192.168.160.2:43598 | gitbase | query   |    0 | running                        | SHOW PROCESSLIST               |
+-----+------+---------------------+---------+---------+------+--------------------------------+--------------------------------+

If I try to kill any of the queries it fails, and the queries keep running.

gitbase> KILL 49;
rpc error: code = Unknown desc = SQL query failed: invalid connection
gitbase> kill 87;
rpc error: code = Unknown desc = SQL query failed: invalid connection
gitbase> kill 123456;
rpc error: code = Unknown desc = SQL query failed: invalid connection

The logs are the same for existing and non-existing PID

time="2019-03-05T18:27:15Z" level=info msg="NewConnection: client 248"
time="2019-03-05T18:27:15Z" level=info msg="audit trail" action=authentication address="192.168.160.2:43606" success=true system=audit user=root
time="2019-03-05T18:27:15Z" level=info msg="kill connection: id 248, pid: 87"
time="2019-03-05T18:27:15Z" level=error msg="Conn 248: Flush() failed: write tcp 192.168.160.4:3306->192.168.160.2:43606: use of closed network connection"
time="2019-03-05T18:27:15Z" level=info msg="ConnectionClosed: client 248"
time="2019-03-05T18:27:24Z" level=info msg="NewConnection: client 249"
time="2019-03-05T18:27:24Z" level=info msg="audit trail" action=authentication address="192.168.160.2:43608" success=true system=audit user=root
time="2019-03-05T18:27:24Z" level=info msg="kill connection: id 249, pid: 123456"
time="2019-03-05T18:27:24Z" level=error msg="Conn 249: Flush() failed: write tcp 192.168.160.4:3306->192.168.160.2:43608: use of closed network connection"
time="2019-03-05T18:27:24Z" level=info msg="ConnectionClosed: client 249"

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy