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

The opennebula-libvirt-exporter produces incomplete data during concurrent requests. #6856

Open
Paucpauc opened this issue Jan 18, 2025 · 0 comments

Comments

@Paucpauc
Copy link

Description
The opennebula-libvirt-exporter produces incomplete data during concurrent requests.

To Reproduce

$ curl 127.0.0.1:9926/metrics -i -s > m1 & curl 127.0.0.1:9926/metrics -i -s > m2
$ ls -l m1 m2
-rw-r--r-- 1 user user 49009 Jan 18 19:45 m1
-rw-r--r-- 1 user user  6776 Jan 18 19:45 m2

Expected behavior
Both m1 and m2 should have complete data and similar file sizes.

Details

  • Affected Component: opennebula-libvirt-exporter
  • Hypervisor: KVM
  • Version: 6.10.0

Additional context
A naive solution to this issue might involve setting a lock to ensure data consistency:

--- /usr/lib/one/libvirt_exporter/libvirt_exporter.rb    2025-01-18 19:55:42.492027428 +0000
+++ /tmp/libvirt_exporter.rb    2025-01-18 19:55:34.824001932 +0000
@@ -73,6 +73,7 @@
 # Default Options
 set :bind, '0.0.0.0'
 set :port, 9926
+set :lock, true

 # Run the Sinatra application
 set :run, false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants