satori-com / satori-video-sdk-cpp

Satori Video C++ SDK
Other
5 stars 7 forks source link

Stop RTM client when we done with everything #247

Closed parsifal-47 closed 6 years ago

parsifal-47 commented 6 years ago

There is race on shutdown:

2018-01-12 13:32:49.528 ( 226.487s) [main thread     ]       signal_utils.cpp:19       0| caught signal Terminated
2018-01-12 13:32:49.528 ( 226.488s) [main thread     ]    bot_environment.cpp:195      0| Got signal #15
2018-01-12 13:32:49.528 ( 226.488s) [main thread     ]       signal_breaker.h:26       0|  breaking the stream, in thread empty-bot
2018-01-12 13:32:49.528 ( 226.488s) [main thread     ]       signal_breaker.h:29       0| cancelling upstream subscription
2018-01-12 13:32:49.528 ( 226.488s) [main thread     ]      threaded_worker.h:124      0| invoking die() from empty-bot, this worker thread processing_worker
2018-01-12 13:32:49.528 ( 226.488s) [main thread     ]       signal_breaker.h:32       0| sending complete signal to downstream
2018-01-12 13:32:49.529 ( 226.488s) [main thread     ]         rtm_client.cpp:404      0| Stopping secure RTM client
2018-01-12 13:32:49.529 ( 226.488s) [main thread     ]    bot_environment.cpp:306      0| rtm client was stopped
2018-01-12 13:32:49.529 ( 226.488s) [main thread     ]            metrics.cpp:189    ERR| timer error: system:125 Operation canceled
2018-01-12 13:32:49.529 ( 226.488s) [main thread     ]         rtm_client.cpp:616      0| 0x56219a0ac000 ping timer is cancelled
2018-01-12 13:32:49.529 ( 226.488s) [main thread     ]         rtm_client.cpp:561      0| 0x56219a0ac000 async_read operation is cancelled
2018-01-12 13:32:49.529 ( 226.488s) [main thread     ]         rtm_client.cpp:462    ERR| publish request failure: [system:9] Bad file descriptor
bot is initializing, libraries are ok
Stack trace:
9       0x5621985039ba /app/empty-bot(+0xbe9ba) [0x5621985039ba]
8       0x7f2d3360b1c1 __libc_start_main + 241
7       0x5621984f9969 /app/empty-bot(+0xb4969) [0x5621984f9969]
6       0x5621984fb5b4 /app/empty-bot(+0xb65b4) [0x5621984fb5b4]
...
parsifal-47 commented 6 years ago

@khabinov what is your current opinion on this? (we could discuss on a call if needed)

khabinov commented 6 years ago

Could you increment conan version too pls?