Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
#916 - add log output on the forced termination of the eosd process
Browse files Browse the repository at this point in the history
  • Loading branch information
pmesnier committed Dec 11, 2017
1 parent 387ef2e commit e9547cc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/net_plugin/include/eos/net_plugin/message_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ namespace eosio {
* discarded.
*/
void reset() {
//dlog ("read_ind = ${r1}, ${r2} write_ind = ${w1}, ${w2}, buff.size = ${bs}, sanity = ${s}",
// ("r1",read_ind.first)("r2",read_ind.second)("w1",write_ind.first)("w2",write_ind.second)("bs",buffers.size())("s",sanity_check));
if( buffers.size() != sanity_check) {
// some condition exists that can send *both* buffers.size() and sanity_check to well over 10^6.
// this seems to be related to some sort of memory overrun possibly. By forcing an exit here, an
// external watchdog can be used to restart the process and avoid hanging.
if( buffers.size() != sanity_check || buffers.size() > 1000000) {
elog ("read_ind = ${r1}, ${r2} write_ind = ${w1}, ${w2}, buff.size = ${bs}, sanity = ${s}",
("r1",read_ind.first)("r2",read_ind.second)("w1",write_ind.first)("w2",write_ind.second)("bs",buffers.size())("s",sanity_check));
elog("Buffer manager overwrite detected. Terminating to allow external restart");
exit(0);
}
while (buffers.size() > 1) {
Expand Down

0 comments on commit e9547cc

Please sign in to comment.