Gekko 0.6 released
#22
Things turn out to get a lot more complex with the database issue. The --import gap was possible to fix with changed utc handling. But there are situations where no data is written to DB. On another machine this was not happening. First showstopper was a version problem of node postgres 6.x package. After updating to 7.x package it is working - but only from time to time. Very hard to reproduce. I added several debug logs and it seems to be a race condition during db insert (it is not a locked transaction right now) and db connection handling. At least I was able to get this error message:

2018-06-28 15:56:05 (DEBUG): Processing 350 new trades. From 2018-06-28 12:53:07 UTC to 2018-06-28 13:56:08 UTC. (an hour)
2018-06-28 15:56:05 (DEBUG): Writing candles to DB!
2018-06-28 15:56:05 (DEBUG): Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (net.js:364:12)
at Connection.query (/git/gekko/node_modules/pg/lib/connection.js:205:15)
at Query.submit (/git/gekko/node_modules/pg/lib/query.js:164:16)
at Client._pulseQueryQueue (/git/gekko/node_modules/pg/lib/client.js:356:24)
at Client.query (/git/gekko/node_modules/pg/lib/client.js:393:8)
at _.each.candle (/git/gekko/plugins/postgresql/writer.js:60:13)
at Function.forEach (/git/gekko/node_modules/lodash/dist/lodash.js:3298:15)
at Store.writeCandles (/git/gekko/plugins/postgresql/writer.js:47:5)
at Store.bound [as writeCandles] (/git/gekko/node_modules/lodash/dist/lodash.js:729:21)
at Store.processCandle (/git/gekko/plugins/postgresql/writer.js:75:10)

Another indication that it probably is a transactional race condition problem: When changing inside the getTrades method to callback(undefined, parsedTrades.reverse()); and forcing to write the lastest (definately not existing candles) first, the problem with a not updating database does not occur.

I think it is necessary to prevent client.end() and release the db connection to a connection pool instead. I will also test the new postgres feature "ON CONFLICT DO NOTHING" for transactional upsert handling instead of checking the insert against a query of existing candles with a certain start time.
  Reply


Messages In This Thread
Gekko 0.6 released - by askmike - 06-24-2018, 10:31 AM
RE: Gekko 0.6 pre release - by mark.sch - 06-24-2018, 01:42 PM
RE: Gekko 0.6 pre release - by askmike - 06-25-2018, 03:41 AM
RE: Gekko 0.6 pre release - by mark.sch - 06-25-2018, 09:24 AM
RE: Gekko 0.6 pre release - by mark.sch - 06-25-2018, 10:29 AM
RE: Gekko 0.6 pre release - by crypto49er - 06-25-2018, 03:43 AM
RE: Gekko 0.6 pre release - by askmike - 06-25-2018, 08:17 AM
RE: Gekko 0.6 pre release - by askmike - 06-26-2018, 05:48 AM
RE: Gekko 0.6 pre release - by Henry151 - 06-26-2018, 05:56 AM
RE: Gekko 0.6 pre release - by askmike - 06-26-2018, 06:16 AM
RE: Gekko 0.6 pre release - by mark.sch - 06-26-2018, 06:44 AM
RE: Gekko 0.6 pre release - by Henry151 - 06-26-2018, 07:36 AM
RE: Gekko 0.6 pre release - by askmike - 06-26-2018, 06:55 AM
RE: Gekko 0.6 pre release - by mark.sch - 06-26-2018, 10:46 AM
RE: Gekko 0.6 pre release - by askmike - 06-26-2018, 08:04 AM
RE: Gekko 0.6 pre release - by askmike - 06-26-2018, 02:01 PM
RE: Gekko 0.6 pre release - by mark.sch - 06-26-2018, 05:06 PM
RE: Gekko 0.6 pre release - by mark.sch - 06-26-2018, 06:55 PM
RE: Gekko 0.6 pre release - by Henry151 - 06-27-2018, 05:16 PM
RE: Gekko 0.6 pre release - by askmike - 06-27-2018, 05:21 PM
RE: Gekko 0.6 pre release - by mark.sch - 06-27-2018, 05:56 PM
RE: Gekko 0.6 pre release - by mark.sch - 06-28-2018, 02:36 PM
RE: Gekko 0.6 pre release - by mark.sch - 06-28-2018, 09:03 PM
RE: Gekko 0.6 pre release - by mark.sch - 06-30-2018, 02:42 PM
RE: Gekko 0.6 pre release - by Kris191 - 07-04-2018, 04:11 AM
RE: Gekko 0.6.0 released - by askmike - 07-04-2018, 10:53 AM
RE: Gekko 0.6.0 released - by Kris191 - 07-04-2018, 07:02 PM
RE: Gekko 0.6.0 released - by ankasem - 07-05-2018, 03:09 AM
RE: Gekko 0.6.0 released - by donkykong017 - 07-05-2018, 04:41 AM
RE: Gekko 0.6.0 released - by askmike - 07-05-2018, 08:41 AM
RE: Gekko 0.6.0 released - by Kris191 - 07-06-2018, 04:29 AM
RE: Gekko 0.6 released - by ankasem - 07-06-2018, 01:12 AM
RE: Gekko 0.6 released - by ankasem - 07-08-2018, 06:25 AM
RE: Gekko 0.6 released - by askmike - 07-06-2018, 05:17 AM
RE: Gekko 0.6 released - by Kris191 - 07-06-2018, 08:05 AM
RE: Gekko 0.6 released - by ankasem - 07-06-2018, 11:31 AM
RE: Gekko 0.6 released - by Kris191 - 07-06-2018, 12:42 PM
RE: Gekko 0.6 released - by Kris191 - 07-07-2018, 05:41 PM
RE: Gekko 0.6 released - by Kris191 - 07-08-2018, 07:24 AM
RE: Gekko 0.6 released - by thegamecat - 07-07-2018, 11:22 AM
RE: Gekko 0.6 released - by Kris191 - 07-08-2018, 02:54 PM
RE: Gekko 0.6 released - by askmike - 07-08-2018, 03:13 PM
RE: Gekko 0.6 released - by Kris191 - 07-08-2018, 07:04 PM
RE: Gekko 0.6 released - by ankasem - 07-08-2018, 08:42 PM
RE: Gekko 0.6 released - by askmike - 07-09-2018, 03:51 AM
RE: Gekko 0.6 released - by askmike - 07-09-2018, 03:52 AM
RE: Gekko 0.6 released - by Kris191 - 07-09-2018, 10:30 AM
RE: Gekko 0.6 released - by askmike - 07-09-2018, 01:31 PM
RE: Gekko 0.6 released - by Kris191 - 07-20-2018, 08:06 AM
RE: Gekko 0.6 released - by Kris191 - 07-09-2018, 01:39 PM
RE: Gekko 0.6 released - by ankasem - 07-09-2018, 05:55 PM
RE: Gekko 0.6 released - by mark.sch - 07-09-2018, 07:11 PM
RE: Gekko 0.6 released - by crypt0r - 07-11-2018, 05:58 PM
RE: Gekko 0.6 released - by crypt0r - 07-11-2018, 09:19 PM
RE: Gekko 0.6 released - by Kris191 - 07-12-2018, 05:38 AM
RE: Gekko 0.6 released - by mark.sch - 07-15-2018, 08:29 PM
RE: Gekko 0.6 released - by wewantmoore - 07-17-2018, 10:57 AM
RE: Gekko 0.6 released - by martyc - 07-17-2018, 11:44 AM
RE: Gekko 0.6 released - by wewantmoore - 07-17-2018, 12:18 PM
RE: Gekko 0.6 released - by martyc - 07-17-2018, 12:22 PM
RE: Gekko 0.6 released - by wewantmoore - 07-17-2018, 12:36 PM
RE: Gekko 0.6 released - by martyc - 07-17-2018, 01:19 PM
RE: Gekko 0.6 released - by wewantmoore - 07-17-2018, 01:24 PM
RE: Gekko 0.6 released - by Kris191 - 07-19-2018, 05:56 AM
RE: Gekko 0.6 released - by dugu-dugu - 07-20-2018, 09:32 AM
RE: Gekko 0.6 released - by ankasem - 07-21-2018, 10:24 PM
RE: Gekko 0.6 released - by wewantmoore - 07-22-2018, 12:00 AM
RE: Gekko 0.6 released - by askmike - 07-22-2018, 12:19 AM
RE: Gekko 0.6 released - by wewantmoore - 07-22-2018, 12:25 AM
RE: Gekko 0.6 released - by wewantmoore - 09-05-2018, 10:17 AM
RE: Gekko 0.6 released - by mark.sch - 08-17-2018, 10:48 PM
RE: Gekko 0.6 released - by askmike - 08-20-2018, 04:07 AM
RE: Gekko 0.6 released - by mark.sch - 08-20-2018, 07:21 AM
RE: Gekko 0.6 released - by askmike - 08-20-2018, 09:42 AM
RE: Gekko 0.6 released - by askmike - 09-06-2018, 04:22 AM
RE: Gekko 0.6 released - by wewantmoore - 09-06-2018, 12:27 PM
RE: Gekko 0.6 released - by betflix - 02-16-2022, 03:49 PM
RE: Gekko 0.6 released - by lily167 - 08-08-2022, 08:01 AM
RE: Gekko 0.6 released - by lily167 - 10-20-2022, 10:25 AM
RE: Gekko 0.6 released - by sexypg168 - 12-01-2022, 02:37 PM
RE: Gekko 0.6 released - by sonisingh - 12-29-2022, 06:29 AM
RE: Gekko 0.6 released - by mariahcarey - 04-10-2023, 08:23 AM
RE: Gekko 0.6 released - by vndehfdl1 - 04-12-2023, 07:54 AM
RE: Gekko 0.6 released - by asshancuc - 04-16-2023, 04:43 AM
RE: Gekko 0.6 released - by nguoilaodong3 - 04-25-2023, 08:28 AM
RE: Gekko 0.6 released - by Xpostands - 06-07-2023, 10:00 AM
RE: Gekko 0.6 released - by ggg123 - 06-13-2023, 02:41 PM
RE: Gekko 0.6 released - by ggg123 - 06-13-2023, 02:42 PM
RE: Gekko 0.6 released - by ggg123 - 06-13-2023, 02:43 PM
RE: Gekko 0.6 released - by kneelbicycle - 06-27-2023, 09:47 AM
RE: Gekko 0.6 released - by andrewcox - 07-13-2023, 01:59 PM
RE: Gekko 0.6 released - by lily167 - 08-01-2023, 11:39 AM
RE: Gekko 0.6 released - by parkwave - 08-16-2023, 04:43 AM
RE: Gekko 0.6 released - by OKBET - 08-23-2023, 07:36 AM
RE: Gekko 0.6 released - by russelltitus - 10-20-2023, 11:08 AM
RE: Gekko 0.6 released - by flyboynyc - 10-23-2023, 01:33 AM
RE: Gekko 0.6 released - by alexcarry7874 - 10-23-2023, 04:09 AM
RE: Gekko 0.6 released - by tracymarchs - 11-01-2023, 02:33 PM
RE: Gekko 0.6 released - by cantona22 - 11-07-2023, 04:18 AM
RE: Gekko 0.6 released - by roniedavid666 - 11-21-2023, 11:00 AM
RE: Gekko 0.6 released - by crispsailor - 01-12-2024, 03:33 PM
RE: Gekko 0.6 released - by mohames332 - 01-30-2024, 10:56 AM
RE: Gekko 0.6 released - by Evelynn - 02-27-2024, 06:04 PM
RE: Gekko 0.6 released - by sabinaholt - 03-27-2024, 12:10 PM
RE: Gekko 0.6 released - by missknoox - 06-04-2024, 03:39 AM
Baby Reindeer Yellow Jacket - by lindawalters - 06-11-2024, 03:33 PM
RE: Gekko 0.6 released - by ChiDavenport - 09-28-2024, 11:57 AM
RE: Gekko 0.6 released - by crispsailor - 10-03-2024, 07:37 AM
RE: Gekko 0.6 released - by harry3784 - 10-03-2024, 08:13 PM
RE: Gekko 0.6 released - by manishapandey - 10-04-2024, 07:45 AM
RE: Gekko 0.6 released - by harry3784 - 10-04-2024, 10:47 PM
RE: Gekko 0.6 released - by ladyjames6600 - 10-05-2024, 07:24 AM
RE: Gekko 0.6 released - by harry3784 - 10-06-2024, 12:32 PM
RE: Gekko 0.6 released - by AbrilM - 10-18-2024, 11:53 AM
RE: Gekko 0.6 released - by vaansh - 10-18-2024, 05:14 AM
RE: Gekko 0.6 released - by AbrilM - 10-18-2024, 11:55 AM
RE: Gekko 0.6 released - by AbrilM - 10-18-2024, 11:56 AM
RE: Gekko 0.6 released - by sanmarconns - 10-21-2024, 07:35 PM
RE: Gekko 0.6 released - by xfinityauthorize - 10-28-2024, 07:07 AM
RE: Gekko 0.6 released - by BeardDemon - 11-22-2024, 10:40 AM
RE: Gekko 0.6 released - by BeardDemon - 11-22-2024, 10:41 AM
RE: Gekko 0.6 released - by corrien parker - 12-03-2024, 09:03 AM

Forum Jump:


Users browsing this thread: