Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feature) Stop active AOs on API keys change #236

Merged
merged 7 commits into from
Jul 4, 2023

Conversation

dmytroshch
Copy link
Contributor

@dmytroshch dmytroshch commented Apr 27, 2023

AO canceled correctly, but there is an error in the logs

[0] 2023-04-27T21:45:20.043Z bfx:hf:server:ws-server:api issuing API & Algo reconnect due to credentials change
[0] 2023-04-27T21:45:20.045Z bfx:hf:server:algo-worker ao instance updated 4794738212864
[0] 2023-04-27T21:45:20.045Z bfx:hf:algo:ao-host triggering life:stop for AO bfx-ping_pong [gid 4794738212864]
[0] 2023-04-27T21:45:20.045Z bfx:hf:algo:bfx-ping_pong:4794738212864 detected ping/pong algo cancellation, stopping...
[0] 2023-04-27T21:45:20.045Z bfx:hf:algo:bfx-ping_pong:4794738212864 emit exec:order:cancel:all [at onLifeStop (/home/dmytro/codecare/bfx-hf-server/node_modules/bfx-hf-algo/lib/ping_pong/events/life_stop.js:26:10)]
[0] 2023-04-27T21:45:20.046Z bfx:hf:algo:bfx-ping_pong:4794738212864 canceling order EXCHANGE LIMIT 0.005 @ 123 [cid 4794738212865 id 1866814474]
[0] 2023-04-27T21:45:20.046Z bfx:hf:algo:bfx-ping_pong:4794738212864 cancelOrder: (id: 1866814474) (cid: 4794738212865) EXCHANGE LIMIT order on BTC/USD (ACTIVE) for 0.00500000 @ 123.00 [aff-code: xZvWHMNR] [at /home/dmytro/codecare/bfx-hf-server/node_modules/bfx-hf-algo/lib/host/events/cancel_all_orders.js:40:25]
[0] 2023-04-27T21:45:20.047Z bfx:hf:server:algo-worker spawning bfx algo host (dms disabled) [aff xZvWHMNR]
[0] 2023-04-27T21:45:20.048Z bfx:hf:server:ws-server:api opening auth bfx connection (dms disabled)
[0] 2023-04-27T21:45:20.053Z bfx:hf:server:algo-worker ao instance updated 4794738212864
[0] 2023-04-27T21:45:20.053Z bfx:hf:server:algo-worker stopped AO for user HF_User on gid: 4794738212864
[0] 2023-04-27T21:45:20.377Z bfx:hf:algo:ao-host:ws2:bind-bus enqueue open
[0] 2023-04-27T21:45:20.377Z bfx:hf:algo:ao-host:ws2:process-message process open
[0] 2023-04-27T21:45:20.446Z bfx:hf:algo:ao-host:ws2:bind-bus enqueue auth:success
[0] 2023-04-27T21:45:20.446Z bfx:hf:algo:ao-host:ws2:process-message process auth:success
[0] 2023-04-27T21:45:20.446Z bfx:hf:server:algo-worker spawned host for HF_User
[0] 2023-04-27T21:45:20.446Z bfx:hf:algo:ao-host:ws2:bind-bus enqueue order:snapshot
[0] 2023-04-27T21:45:20.446Z bfx:hf:algo:ao-host:ws2:process-message process order:snapshot
[0] websocket error: Failed to start services: auth timeout
[0] 2023-04-27T21:45:23.047Z bfx:hf:algo:bfx-ping_pong:4794738212864 received error while canceling order(id: 1866814474, cid: 4794738212865): EXCHANGE LIMIT 0.005 @ 123 [ERROR: Error: Response timeout for n:oc-req:1866814474:success and n:oc-req:1866814474:error
[0] at Timeout. (/home/dmytro/codecare/bfx-hf-server/node_modules/bfx-hf-algo/node_modules/bfx-api-node-core/lib/util/watch_response.js:32:14)
[0] at listOnTimeout (internal/timers.js:557:17)
[0] at processTimers (internal/timers.js:500:7)]
[0] Unhandled rejection: auth timeout
[0] Unhandled rejection: auth timeout
[0] ! process. -> process (/home/dmytro/codecare/bfx-hf-ui/node_modules/bfx-hf-util/lib/catch_uncaught_errors.js) [41:%s]
[0] ! emit -> process (events.js) [412:%s]
[0] ! processPromiseRejections -> null (internal/process/promises.js) [245:%s]
[0] ! processTicksAndRejections -> process (internal/process/task_queues.js) [96:%s]
[0] ! process. -> process (/home/dmytro/codecare/bfx-hf-server/node_modules/bfx-hf-util/lib/catch_uncaught_errors.js) [41:%s]
[0] ! emit -> process (events.js) [412:%s]
[0] ! processPromiseRejections -> null (internal/process/promises.js) [245:%s]
[0] ! processTicksAndRejections -> process (internal/process/task_queues.js) [96:%s]


Copy link
Contributor

@avsek477 avsek477 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, lint and test updates are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants