Polling sensor logic weird


(Jimmy0628) #1

Has anybody encountered a strange problem about the st2sensorcontainer? When I debug my sensor, it works fine, and the action can only be triggered according to my intention. But when I try to register my sensor and let it run by the system, I found my action is always be executed. It seems really weired.


(Warren) #2

Hi @jimmy0628.

I personally haven’t seen this sort of behavior. If you could tell us more - for instance, the version of stackstorm you’re using, its config, and the logs from st2sensorcontainer. Please be sure to remove any confidential info.

Thanks!


(Jimmy0628) #3

sorry, I finally found it was my fault. My logic depends on the stdout to print the output return by the shell scirpts, however, when the sensor was executed in the background, the logic failed because the sensor could not get stdout output anymore. However, when I execute the sensor in the foreground with debugger, the stdout will print out the information that is depended on by the sensor. That is the reason why the logic is different. :slight_smile:
I would say, I marked what I found here is just a reference when someone else was confused they can find a clue.