-
-
Couldn't load subscription status.
- Fork 251
QA: fix qa 867 #2379
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
QA: fix qa 867 #2379
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @kimullaa ... this is still not working for me, I'm afraid.
- you need to rm -f /tmp/httpcache.sock before running socat
- the test hangs in httpcache
Here is some debugging I've been able to collect ...
$ sh -x 867
+ basename 867
+ seq=867
+ echo QA output created by 867
...
+ rm -f /var/tmp/867-19435.socat.out /var/tmp/867-19435.socat.err /tmp/httpcache.sock
+ socat_pid=19586
+ socat -d -d unix-listen:/tmp/httpcache.sock,fork tcp-connect:localhost:44323
+ echo == Check HTTP cache
+ tee -a /home/kenj/src/pcp/qa/867.full
== Check HTTP cache
+ /home/kenj/src/pcp/qa/src/httpcache
and httpcache never exits.
$ cat /var/tmp/867-19435.socat.err
2025/10/23 07:45:00 socat[19586] N listening on AF=1 "/tmp/httpcache.sock"
$ cat /var/tmp/867-19435.socat.out
$ pstree -p 19435
sh(19435)─┬─httpcache(19589)
└─socat(19586)
$ gdb -p 19589 ~/src/pcp/qa/src/httpcache
...
(gdb) where
#0 0x000075589f32bbfd in __libc_recv (fd=3, buf=0x7ffe848bf910, len=8192,
flags=0) at ../sysdeps/unix/sysv/linux/recv.c:28
#1 0x000075589f63844a in __pmRecv () from /lib/libpcp.so.4
#2 0x000075589f5476ca in ?? () from /lib/libpcp_web.so.1
#3 0x000075589f54864a in pmhttpClientGet () from /lib/libpcp_web.so.1
#4 0x000055c0640b729c in call_http_get (
url=0x55c0640b8070 "http://localhost:44323/series/metrics?match=kernel.all.load") at httpcache.c:19
#5 0x000055c0640b7463 in main (argc=1, argv=0x7ffe848c1b38) at httpcache.c:65
Hope that's enough for you to figure out the issue(s).
|
Sorry @kimullaa this is still not working for me. It now hangs in the first iteration of the added socat block. |
9d05eef to
08d5ce9
Compare
|
@kimullaa Still no luck for me ... it is back to hanging in httpcache. |
|
@kmcdonell thank you for a advice!That’s very helpful. Hmm, I don’t think I’ve changed the configuration.
It is a good practice, so I’ll incorporate that. I hope this fix resolves the issue, but if it doesn’t,I'd like to reproduce the hang myself — could you tell me about your environment, such as which distribution you're using? |
- start a private pmproxy and key server - check if socat is running - clean up $tmp files and processes Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
|
G'day @kimullaa Latest version works 100% for me ... 🍻 Just one small nit in httpcache.c ... please use pmsprintf() in place of sprintf() ... the extra (2nd) argument protects against buffer overrun (it is not really an issue here, but various compilers and code analysers we use will complain and require the change to be made anyway to keep our "no compiler warnings or code analyser issues" goal). For reference my main failing system is a 64-bit Ubuntu 24.04, but I think taking control of your own key server and pmproxy instance was the key (excuse the pun), not the platform per se. Cheers, Ken. |
follow the QA 983 style(cleanup the socat using pmsignal)
It works in my environment, but I haven't confirmed whether it works in the CI environment.