mysql icon indicating copy to clipboard operation
mysql copied to clipboard

stuck when run client.query(...)

Open linweiwei123 opened this issue 5 years ago • 7 comments
trafficstars

log shows: NFO connecting 127.0.0.1:3306. It never callback, stuck forever.

ENV: deno: 1.0.0 mysql: 8.0

linweiwei123 avatar Jun 24 '20 14:06 linweiwei123

Could u post your code also? Currently context doesn't help to narrow down the scope of problem.

wenjoy avatar Jun 25 '20 00:06 wenjoy

Hi, I have a problem with the query function. After a few selects our software stops working. Query never returns any callback and displays no error. When querying the database (serverVersion: "5.5.5-10.3.23-MariaDB-0 + deb10u1") with the same selects and when using a database client, eg Worbench, the server always returns the correct value. In this case, it is performed correctly even for more attempts. I am using Deno 1.2.3. I can't update it due to problems with other packages we are using. Could this be related to poolSize (connection limit) setting? What should the standard value be there? Do you have any ideas on how to fix this problem?

ajasinski77 avatar Oct 13 '20 12:10 ajasinski77

@ajasinski77 Thanks for reporting.

  1. Which deno_mysql version did you used?

  2. How frequently did the problem occur?

  3. We have fixed some connection bugs recently. Could you try the latest commit? (Import from https://github.com/manyuanrong/deno_mysql/raw/00d4651316a66b7cb7d98625380c98098556a26b/mod.ts)

lideming avatar Oct 13 '20 14:10 lideming

I tried on different versions, including the last one (2.5.0) and this problem occurs every time.

The frequency of the problem varies. Sometimes every 10 tries, sometimes every 1000 tries. Unfortunately, every time the API that uses this connection crashes.

ajasinski77 avatar Oct 14 '20 06:10 ajasinski77

@ajasinski77 Please try the latest commit I mentioned above. We have some unreleased fixes since v2.5.0. Hope there is the fix you need.

lideming avatar Oct 14 '20 06:10 lideming

I was having similar problems. I would connect and send a half dozen queries. The program would often hang forever when I said await client.query(...). It would hang on different queries for no obvious reasons. Other times the program would run to the end and exit properly.

When I upgraded to https://github.com/manyuanrong/deno_mysql/raw/00d4651316a66b7cb7d98625380c98098556a26b/mod.ts things changed. All of my queries complete. However, the program never exits. It hangs in function handleTimerMacrotask() in 11_timers.js.

I'm running multiple asyncs at the same time. Usually Deno is smart enough to end when the last one finishes. But not with your latest commit.

TradeIdeasPhilip avatar Oct 23 '20 00:10 TradeIdeasPhilip

@TradeIdeasPhilip

All of my queries complete. However, the program never exits. It hangs in function handleTimerMacrotask() in 11_timers.js.

An unclosed client with idle connections will prevent Deno from automatically exiting. Opened a new issue (#87), see it for details and workaround.

lideming avatar Oct 23 '20 18:10 lideming