Does xorm open multiple connections for reading data from cached tables? #475

Closed
opened 2016-10-22 22:55:59 +00:00 by tamalsaha · 1 comment
tamalsaha commented 2016-10-22 22:55:59 +00:00 (Migrated from github.com)

We are using xorm with our apiserver. We cache few config-type tables using LRUCacher of xorm. We have noticed that when get operations are performed on those tables, 2 connections are opened. One connection is the actual connection opened from our code. The other connection is used by xorm to perform an inner query. Can you please confirm that is how xorm works?
goroutine-stuck

We are interested in understanding this because I think this is causing deadlocks in our server. We set maxOpenConnection = 2. Now when 2 simultaneous api calls are made, sometimes both response handlers get stuck in the innerquery, waiting for new connection (see attached pprof stack trace).

We are using xorm with our apiserver. We cache few config-type tables using LRUCacher of xorm. We have noticed that when `get` operations are performed on those tables, 2 connections are opened. One connection is the actual connection opened from our code. The other connection is used by xorm to perform an inner query. Can you please confirm that is how xorm works? ![goroutine-stuck](https://cloud.githubusercontent.com/assets/94814/19623038/4f7a343a-986f-11e6-9101-21f584b124ad.png) We are interested in understanding this because I think this is causing deadlocks in our server. We set maxOpenConnection = 2. Now when 2 simultaneous api calls are made, sometimes both response handlers get stuck in the innerquery, waiting for new connection (see attached pprof stack trace).
tamalsaha commented 2016-10-23 03:59:48 +00:00 (Migrated from github.com)

Thanks @lunny 💯

Thanks @lunny :100:
lunny referenced this issue from a commit 2020-03-09 02:52:44 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#475
No description provided.