src-d / gitbase

SQL interface to git repositories, written in Go. https://docs.sourced.tech/gitbase
Apache License 2.0
2.06k stars 124 forks source link

Connection timeout is not being triggered on bblfsh long time ParseRequest handling #950

Closed lwsanty closed 5 years ago

lwsanty commented 5 years ago

summary when bblfshd ParseRequest process lasts longer than GITBASE_CONNECTION_TIMEOUT queries are executed successfully without related errors returned or logged

version remote:master, I guess 63457237d036e77fd40f23cb6742122efe0679b4

reproduction this behavior was reproduced during integration tests development with bblfshd mockups 1) prepare bblfsh mockup that performs sleep responseLag time during the ParseRequest and returns specific errText error on parse request 2) run gitbase with GITBASE_CONNECTION_TIMEOUT = responseLag - 1 second 3) execute query uastQuery 4) check that warning(or error?) related to timeout appeared?

expected timeout errors or warnings in gitbase logs

reproduce in test TestQueryExecAfterTimeout Please take into account that test itself is in WIP state, so the only useful info there is logs that it emits

logs note: these parse warnings are related to mockup so they do not worth to be taken into account

[2019-08-14T19:02:45.479972779+03:00]  INFO out: time="2019-08-14T19:02:14+03:00" level=info msg="squash tables rule is enabled"
time="2019-08-14T19:02:14+03:00" level=info msg="server started and listening on localhost:3306"
time="2019-08-14T19:02:15+03:00" level=info msg="NewConnection: client 1"
time="2019-08-14T19:02:15+03:00" level=info msg="audit trail" action=authentication address="127.0.0.1:43720" success=true system=audit user=root
time="2019-08-14T19:02:15+03:00" level=info msg="audit trail" action=authorization address="127.0.0.1:43720" connection_id=1 permission=read pid=1 query="select file_path, uast(blob_content) name \nfrom refs natural \njoin commit_files natural \njoin blobs \nwhere LANGUAGE(file_path) = 'Go' \nlimit 10" success=true system=audit user=root
time="2019-08-14T19:02:17+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Unknown desc = parse error"
time="2019-08-14T19:02:19+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Unknown desc = parse error"
time="2019-08-14T19:02:21+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Unknown desc = parse error"
time="2019-08-14T19:02:23+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Unknown desc = parse error"
time="2019-08-14T19:02:25+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Unknown desc = parse error"
time="2019-08-14T19:02:27+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Unknown desc = parse error"
time="2019-08-14T19:02:29+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Unknown desc = parse error"
time="2019-08-14T19:02:31+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Unknown desc = parse error"
time="2019-08-14T19:02:33+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Unknown desc = parse error"
time="2019-08-14T19:02:35+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Unknown desc = parse error"
time="2019-08-14T19:02:35+03:00" level=info msg="audit trail" action=query address="127.0.0.1:43720" connection_id=1 duration=20.047866015s pid=1 query="select file_path, uast(blob_content) name \nfrom refs natural \njoin commit_files natural \njoin blobs \nwhere LANGUAGE(file_path) = 'Go' \nlimit 10" success=true system=audit user=root
time="2019-08-14T19:02:35+03:00" level=warning msg="unable to parse the given blob using bblfsh: rpc error: code = Canceled desc = context canceled"

other info possibly related to https://github.com/src-d/go-mysql-server/pull/801 but IMO it's not, because in my case query return rows

lwsanty commented 5 years ago

rechecked this test with https://github.com/src-d/go-mysql-server/pull/801 and it's seems to be working need to recheck this issue after merge

lwsanty commented 5 years ago

src-d/go-mysql-server#801 is closed, need to recheck https://github.com/src-d/go-mysql-server/pull/806 instead

lwsanty commented 5 years ago

closing as issue is not more reproduced after https://github.com/src-d/go-mysql-server/pull/806