Repository navigation
Extract of deep mind logger in libraries/fc directly - #148
Conversation
742854b to
77557d0
Compare
- Removal of dmlog macro - Using `io_service.stop` instead of hard `exit(1)` - Remove logger default config changes
aacf4f1 to
20041fc
Compare
|
Pushed with latest changes. |
|
@heifner Reverted the changes. If you are about to merge, tell me before it, I'll squash all the changes into a single commit. |
|
@maoueh squash is not needed. You should be able to merge. I assume now you will update the eos PR. |
| int retries = 0; | ||
| auto remaining_size = message.size(); | ||
| auto message_ptr = message.c_str(); | ||
| while (true) { |
There was a problem hiding this comment.
For some reason, fwrite returns zero (due to certain error), then retries causing asio stop, never can get out of the loop.
if (written == remaining_size) alone is not good enough, please handle the error cases
There was a problem hiding this comment.
Indeed, good catch, the loop had exit(1) before which was getting out of the loop.
I changed this. After calling stop, I return immediately and set an is_stopped variable to true.
Then, upon the next log call, if stopped, I log a message indicating termination of the dmlog appender and return right away.
|
|
||
| fprintf(stderr, "DMLOG FPRINTF_FAILED failed written=%lu remaining=%lu %d %s\n", written, remaining_size, ferror(out), strerror(errno)); | ||
|
|
||
| if (retries++ > 5) { |
There was a problem hiding this comment.
anything else needs to do when retry limits being reached?
There was a problem hiding this comment.
Not really, it's time to exit and check the machine, there is something bad happening.
I however added a is_stopped state to the logger since the io_service->stop is not in effect immediately.
Should be enough like that.
|
@heifner @allenhan2 Don't have rights to merge. Once merged, I'll update EOS PR with merged commit. |
|
merged, thanks for all works |
Ping @heifner
Linked with EOSIO/eos#8788