Strange BUG

in #blog6 years ago

I have a program that monitors everything in the steem blockpakistan in real time. One of the functions is to process the post. After simple filtering, if the post meets the criteria, I will open a new thread to perform further operations.
image.png

But the program ran up and suddenly found out that some posts were missing. I just couldn't understand why I would miss it. In order to determine the reason, I added some output information in the program. For example, when the first pass is filtered, the record is finally passed through the filtered post. When the second pass is processed, each operation step is recorded.

Then I judged that it was in the second pass, the program judged that the post was edited, so I lost it and did not handle it. This is done because I can process the same post once, so I only deal with the original first post.

But the problem is, since I processed the original post, but why is it missed, or is it because the editor caused the post to be discarded?

I thought about it, and finally I finally understood, from my monitoring to the new post to filter, to the thread to determine whether the post was edited, there is a short time difference, especially when the node response is slow or unstable, This time difference is significantly increased, it may be as long as 2-3 seconds, and once the user edits the post in these two or three seconds, then I will judge in the thread, the status of the post becomes edited.

This is the root of the problem, which means that if the user does not post the editor within 2-3 seconds, or the node of the steem API is stable enough to respond quickly, this problem will not occur, but it does happen.
image.png

It seems that I think the problem is still not good. Fortunately, this is not an important STEEM program. If I am a missile or a rocket, will this problem be blown up by the friendly army? Now think about it, it is still wise to not go to the strategic missile force that year, haha.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.034
BTC 64231.88
ETH 3128.59
USDT 1.00
SBD 3.95