Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[change] Stop sending data on repeated 404 responses #105 #130

Merged
merged 1 commit into from
May 7, 2024

Conversation

pandafy
Copy link
Member

@pandafy pandafy commented May 2, 2024

The openwisp-monitoring agent will exit (killing both the processes for collecting and sending data) if the device has been deleted from OpenWISP Controller.

The delete is determined by checking if the openwisp-config agent agent is running, which exits on repeated 404 response for checksum response.

Closes #105

@coveralls
Copy link

coveralls commented May 2, 2024

Pull Request Test Coverage Report for Build 8924705555

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 6 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.05%) to 99.768%

Files with Coverage Reduction New Missed Lines %
../files/lib/openwisp-monitoring/interfaces.lua 1 99.18%
test_dhcp.lua 1 98.11%
test_wifi.lua 2 98.54%
../files/sbin/netjson-monitoring.lua 2 98.54%
Totals Coverage Status
Change from base Build 7574230204: 0.05%
Covered Lines: 3013
Relevant Lines: 3020

💛 - Coveralls

The openwisp-monitoring agent will exit (killing both the
processes for collecting and sending data) if the device
has been deleted from OpenWISP Controller.

The delete is determined by checking if the openwisp-config agent
agent is running, which exits on repeated 404 response
for checksum response.

Closes #105
@pandafy
Copy link
Member Author

pandafy commented May 2, 2024

In my testing, I configured the openwisp-config agent to only retry once for re-spawning process and retry fetching checksum using the following settings

        option respawn_retry '1'
	option checksum_max_retries '1'

I did this to speed-up the time required for manual testing on the router.

I observed the logs after deleting the device from the controller, which are as follows

Thu May  2 13:01:30 2024 daemon.warn openwisp: Failed to retrieve checksum: 404 Not Found
Thu May  2 13:01:30 2024 daemon.err openwisp: Giving up and shutting down: the device may have been deleted from OpenWISP Controller
Thu May  2 13:01:35 2024 daemon.info openwisp-monitoring: OpenWISP monitoring daemon stopping
Thu May  2 13:01:35 2024 daemon.info openwisp-monitoring: OpenWISP monitoring daemon started
Thu May  2 13:01:36 2024 daemon.warn openwisp: Failed to retrieve checksum: 404 Not Found
Thu May  2 13:01:36 2024 daemon.err openwisp: Giving up and shutting down: the device may have been deleted from OpenWISP Controller
Thu May  2 13:01:36 2024 daemon.info procd: Instance openwisp_config::instance1 s in a crash loop 2 crashes, 2 seconds since last crash
Thu May  2 13:01:36 2024 daemon.err openwisp-monitoring: Giving up and shutting down: the device may have been deleted from OpenWISP Controller
Thu May  2 13:01:44 2024 daemon.err openwisp-monitoring: Giving up and shutting down: the device may have been deleted from OpenWISP Controller
Thu May  2 13:01:44 2024 daemon.info procd: Instance openwisp-monitoring::openwisp-monitoring_collect_data s in a crash loop 2 crashes, 2 seconds since last crash
Thu May  2 13:01:44 2024 daemon.info procd: Instance openwisp-monitoring::openwisp-monitoring_send_data s in a crash loop 2 crashes, 2 seconds since last crash

We can observe in the logs that openwisp-config agent exits twice (because of the configuration) and so does the collect and send processes of openwisp-monitoring agent.

@pandafy pandafy force-pushed the issues/105-404-stop-sending-data branch from c83a616 to 8df816e Compare May 2, 2024 13:28
@nemesifier nemesifier merged commit 2b81fb9 into master May 7, 2024
2 checks passed
@nemesifier nemesifier deleted the issues/105-404-stop-sending-data branch May 7, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[change] Stop sending data on repeated 404 responses
3 participants