author | Yoga Ramalingam <yramalingam1@bloomberg.net> | |
Wed, 12 Nov 2014 21:07:15 +0000 (16:07 -0500) | ||
committer | Yoga Ramalingam <yramalingam1@bloomberg.net> | |
Fri, 28 Nov 2014 21:03:52 +0000 (16:03 -0500) | ||
commit | 993900f43c19c3836a6a4e89268ffb6d17d0fce0 | |
tree | 54103e105e014f4bf177695104b58f4f961341d9 | tree | snapshot |
parent | 51a4e62d7d0e73d8d5822efaef1e3218b5ad0373 | commit | diff |
collectdctl command hangs on AIX and returns error 0 on Solaris.
Summary:
Problem: collectdctl command hangs on AIX and returns error 0 on Solaris.
Root cause - client (collectdctl) and server (collectd daemon) are using fprintf to communicate using Unix domain socket, Since fprintf buffers, command sent by client did not reach server, since client does not get the response, it closes the socket which forces the client to flush the command, now server receives the command, when responding, it gets socket error because the client already closed the socket.
Solution: Added flush after all fprintf calls.
Test Plan: Tested collectdctl on AIX and SunOS for listval, getval commands
Reviewers: skhajamo
Reviewed By: skhajamo
CC: arcyd
Differential Revision: https://all.phab.dev.bloomberg.com/D155584
Summary:
Problem: collectdctl command hangs on AIX and returns error 0 on Solaris.
Root cause - client (collectdctl) and server (collectd daemon) are using fprintf to communicate using Unix domain socket, Since fprintf buffers, command sent by client did not reach server, since client does not get the response, it closes the socket which forces the client to flush the command, now server receives the command, when responding, it gets socket error because the client already closed the socket.
Solution: Added flush after all fprintf calls.
Test Plan: Tested collectdctl on AIX and SunOS for listval, getval commands
Reviewers: skhajamo
Reviewed By: skhajamo
CC: arcyd
Differential Revision: https://all.phab.dev.bloomberg.com/D155584