Closed jaros1 closed 6 years ago
Added wait_timeout function to queue_publish request. Waiting max 120 seconds for a start_publish request from MN.
Maybe already tested OK. Found in a number of old tests:
Issue #262 Test 20 https://github.com/jaros1/Money-Network/issues/262#issuecomment-353338617. wait_timeout was executed but some issues in publish workflow:
Several queue_publish events at the same time. Hard to optimize as cb code is different for each publish event. Added better log and added reason to publish calls. Now writing publish reason before starting sitePublish and after finished with sitePublish. Should make logs easier to read.
Added extra fallback code in queue_publish.
Extra fallback code used in testcase 8A in issue #298 torando:
issue298-test8a-torando-mn.log issue298-test8a-torando-w2.log
18:58:27.519 MoneyNetworkAPI.js:2816 MoneyNetworkAPILib.queue_publish.wait_timeout/692: last_published = 1515607097, now = 1515607107, elapsed = 10 18:58:27.520 MoneyNetworkAPI.js:2832 MoneyNetworkAPILib.queue_publish.wait_timeout/692: Timeout while waiting for start_publish message from MN. starting publish in 20000 ms 18:58:48.519 MoneyNetworkAPI.js:2827 MoneyNetworkAPILib.queue_publish.wait_timeout/692: Timeout while waiting for start_publish message from MN. Starting publish now
Fallback code in wait_timeout was OK. Delayed publish in W2 session with 20 seconds. OK published message to MN. Publish interval in MN session was 31 seconds and no ratelimit error.
start_publish request from MN to W2 was never received by W2. W2 processed 5 other older incoming messages. Better to process newest messages first and wait with old messages. Should solve problems with MN-W2 processing. OK to try to process old messages but newest messages should have 1. priority. Changed order by in message_demon.
Wallet publish workflow is:
Wait max seconds for a start_publish request. There could be communication problems, lost messages, stopped UI server or whatever.