NebraLtd / hm-diag

Helium Miner Diagnostics
https://nebra.io/hnt
MIT License
21 stars 23 forks source link

A potential Packet Forwarder container failure would cause the diagnostics stall #288

Open MuratUrsavas opened 2 years ago

MuratUrsavas commented 2 years ago

Right now the Diagnostics container waits for information from Packet Forwarder and it does not use a timeout logic. Hence a potential problem in Packet Forwarder would cause the Diagnostics stall in an infinite loop and stop report creation.

We have to fix hardware.py/lora_module_test() function.

I'd like to assign this issue to myself and label it as a bug, but will let you decide.

kashifpk commented 2 years ago

@MuratUrsavas - What is your suggested approach to improving the implementation for lora_module_test()?

marvinmarnold commented 2 years ago

For reference, this is the relevant pktfwd code that writes to the file that diag looks for.

I'm not sure what the original intention of waiting for pktfwd to start before generating a diagnostics report was, but I agree that it no longer makes sense. The minimal fix would be removing the while loop and returning False if the file isn't found.

But I think we might as well get started on https://github.com/NebraLtd/Hotspot-Production-Tool/issues/28 if we tackle this. In which case, we would need to:

kashifpk commented 2 years ago

Yes, I second that. If we delay https://github.com/NebraLtd/Hotspot-Production-Tool/issues/28 too much I'm afraid it will go into icebox. We have some time available with CNY to tack such stuff and get rid of /initFile.txt.

MuratUrsavas commented 2 years ago

@MuratUrsavas - What is your suggested approach to improving the implementation for lora_module_test()?

Originally my intention was to add a timeout logic into the while loop. But since you're saying it's actually one time check task, then we can get rid of the while loop completely.

MuratUrsavas commented 2 years ago

I'd like to fix this issue also in this sprint because probably this is giving me the headache I'm facing right now. While poking the miner @vpetersson just set up, seeing the same attitude like my test device. Diagnostics container doesn't create any reports and accessing via web is impossible. Browser connects successfully but the device does not respond with any data to the request.

shawaj commented 1 year ago

Think this is fixed @KevinWassermann94 @MuratUrsavas - could you confirm?

Looking at... https://github.com/NebraLtd/hm-diag/blob/c8ef9542e845236ca925231362c1f6dec7f09e1a/hw_diag/utilities/hardware.py#L300