eosnetworkfoundation / mandel

Obsolete. Use https://github.com/AntelopeIO/leap instead.
Other
87 stars 27 forks source link

[3.2] FIFO (named pipe) support for deep-mind logging #723

Closed linh2931 closed 2 years ago

linh2931 commented 2 years ago

Resolve https://github.com/eosnetworkfoundation/mandel/issues/221.

A nodeos new option is added to support FIFO deep-mind logging:

  --deep-mind-fifo arg                     FIFO (named pipe) path for deep-mind
                                           logging. It is created either via
                                           mkfifo beforehand or dynamically. Only
                                           one of deep-mind and deep-mind-fifo can
                                           be enabled

Unit tests and integration tests are added.

https://github.com/eosnetworkfoundation/mandel-fc/pull/49 is the changes required in FC submodule.

spoonincode commented 2 years ago

I'd like to understand a little more about the use case of this and what the limitations/dangers are and if we are content with those.

The linked issue mentions

Also the deep-mind reader can disconnect and reconnect to the pipe, without stopping the nodeos.

as a reason for this change, but this PR as is does not accommodate that from what I can see with a quick look over. If the consumer disconnects it appears impossible for it to sanely reconnect. Minimally it'll miss messages (nodeos won't wait for the consumer to reconnect, nor will it buffer messages), but it's also possible it'll reconnect mid-message and it'll have to be smart enough to "resync".

What this does allow is restarting nodeos without restarting the consumer. And maybe that's useful?

Also, whenever we add POSIXy stuff like this change contains, I'd like for us to take a swing at #ifdef _WIN32ing it. It doesn't have to be perfect and correct (as we have to real easy way to test) but it could help us out in the future.

linh2931 commented 2 years ago

Close this together with https://github.com/eosnetworkfoundation/mandel-fc/pull/49. Please see discussions there.