Bug 1354395 - rpc-transport: compiler warning format string
Summary: rpc-transport: compiler warning format string
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: rpc
Version: 3.8.0
Hardware: x86_64
OS: All
medium
medium
Target Milestone: ---
Assignee: Mohit Agrawal
QA Contact:
URL:
Whiteboard:
Depends On: 1336508
Blocks: 1354394
TreeView+ depends on / blocked
 
Reported: 2016-07-11 08:42 UTC by Mohit Agrawal
Modified: 2016-08-12 09:47 UTC (History)
4 users (show)

Fixed In Version: glusterfs-3.8.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1336508
Environment:
Last Closed: 2016-08-12 09:47:17 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Mohit Agrawal 2016-07-11 08:42:31 UTC
+++ This bug was initially created as a clone of Bug #1336508 +++

Description of problem:



Making all in rpc-transport
Making all in socket
Making all in src
  CC       socket.lo
  CC       name.lo
In file included from ../../../../libglusterfs/src/common-utils.h:35:0,
                 from ../../../../libglusterfs/src/dict.h:18,
                 from ../../../../rpc/rpc-lib/src/rpc-transport.h:61,
                 from socket.h:25,
                 from socket.c:11:
socket.c: In function '_socket_reap_own_threads':
socket.c:220:33: warning: format '%zu' expects argument of type 'size_t', but argument 2 has type 'pthread_t {aka long unsigned int}' [-Wformat=]
                                 "own-thread: failed to join thread (tid: %zu)",
                                 ^
../../../../libglusterfs/src/logging.h:208:46: note: in definition of macro 'FMT_WARN'
 #define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                              ^~~
socket.c:219:25: note: in expansion of macro 'gf_log'
                         gf_log (THIS->name, GF_LOG_ERROR,
                         ^~~~~~
socket.c:220:33: warning: format '%zu' expects argument of type 'size_t', but argument 7 has type 'pthread_t {aka long unsigned int}' [-Wformat=]
                                 "own-thread: failed to join thread (tid: %zu)",
                                 ^
../../../../libglusterfs/src/logging.h:259:34: note: in definition of macro 'gf_log'
                          levl, ##fmt);                                  \
                                  ^~~
  CCLD     socket.la
Making all in rdma




Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Vijay Bellur on 2016-06-10 06:16:14 EDT ---

REVIEW: http://review.gluster.org/14694 (rpc/socket.c In socket_spawn function it creates thread for socket_poller    And also start reaper thread to avoid thread leakup.    Same can be achieve by after enable detach flag at the time of creation of threads.    It is simple and no need to maintain any queue for store thread ids.) posted (#1) for review on master by Anonymous Coward

--- Additional comment from Vijay Bellur on 2016-06-13 03:11:42 EDT ---

REVIEW: http://review.gluster.org/14694 (rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#2) for review on master by Anonymous Coward

--- Additional comment from Vijay Bellur on 2016-06-15 09:13:37 EDT ---

REVIEW: http://review.gluster.org/14694 (;rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#3) for review on master by Anonymous Coward

--- Additional comment from Vijay Bellur on 2016-06-16 05:10:32 EDT ---

REVIEW: http://review.gluster.org/14694 (rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#4) for review on master by Anonymous Coward

--- Additional comment from Vijay Bellur on 2016-06-16 05:12:47 EDT ---

REVIEW: http://review.gluster.org/14694 (rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#5) for review on master by Anonymous Coward

--- Additional comment from Vijay Bellur on 2016-06-17 03:41:47 EDT ---

REVIEW: http://review.gluster.org/14694 (rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#6) for review on master by MOHIT AGRAWAL (moagrawa)

--- Additional comment from Vijay Bellur on 2016-06-17 06:02:22 EDT ---

REVIEW: http://review.gluster.org/14694 (rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#7) for review on master by MOHIT AGRAWAL (moagrawa)

--- Additional comment from Vijay Bellur on 2016-06-20 03:12:47 EDT ---

REVIEW: http://review.gluster.org/14694 (rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#8) for review on master by MOHIT AGRAWAL (moagrawa)

--- Additional comment from Vijay Bellur on 2016-06-20 06:56:50 EDT ---

REVIEW: http://review.gluster.org/14694 (rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#9) for review on master by MOHIT AGRAWAL (moagrawa)

--- Additional comment from Vijay Bellur on 2016-06-21 09:53:53 EDT ---

REVIEW: http://review.gluster.org/14694 (    rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#10) for review on master by MOHIT AGRAWAL (moagrawa)

--- Additional comment from Vijay Bellur on 2016-06-24 09:23:55 EDT ---

COMMIT: http://review.gluster.org/14694 committed in master by Jeff Darcy (jdarcy) 
------
commit 2ee48474be32f6ead2f3834677fee89d88348382
Author: Mohit Agrawal <moagrawa>
Date:   Mon Jun 13 12:41:15 2016 +0530

        rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.
    
        Problem: Current approach to cleanup threads of socket_poller is not appropriate.
    
        Solution: Enable detach flag at the time of thread creation in socket_spawn.
    
        Fix: Write a new wrapper(gf_create_detach_thread) to create detachable thread
             instead of store thread ids in a queue.
    
        Test: Fix is verfied on gluster process, To test the patch followed below procedure
              Enable the client.ssl and server.ssl option on the volume
              Start the volume and count anon segment in pmap output for glusterd process
              pmap -x <glusterd-pid> | grep "\[ anon \]" | wc -l
              Stop the volume and check again count of anon segment it should not increase.
    
    Signed-off-by: Mohit Agrawal <moagrawa>
    Change-Id: Ib8f7ec7504ec8f6f74b45ce6719b6fb47f9fdc37
    BUG: 1336508
    Reviewed-on: http://review.gluster.org/14694
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: Atin Mukherjee <amukherj>
    CentOS-regression: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: Jeff Darcy <jdarcy>

Comment 1 Vijay Bellur 2016-07-11 09:59:28 UTC
REVIEW: http://review.gluster.org/14891 (rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#1) for review on release-3.8 by MOHIT AGRAWAL (moagrawa)

Comment 2 Vijay Bellur 2016-07-21 06:47:55 UTC
REVIEW: http://review.gluster.org/14891 (rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.) posted (#2) for review on release-3.8 by MOHIT AGRAWAL (moagrawa)

Comment 3 Vijay Bellur 2016-07-21 14:24:52 UTC
COMMIT: http://review.gluster.org/14891 committed in release-3.8 by Jeff Darcy (jdarcy) 
------
commit e8a253188f4f8cc5601f4c6b66d706d6ff720f97
Author: Mohit Agrawal <moagrawa>
Date:   Mon Jun 13 12:41:15 2016 +0530

    rpc/socket.c: Modify approach to cleanup threads of socket_poller in socket_spawn.
    
    Problem: Current approach to cleanup threads of socket_poller is not appropriate.
    
    Solution: Enable detach flag at the time of thread creation in socket_spawn.
    
    Fix: Write a new wrapper(gf_create_detach_thread) to create detachable thread
         instead of store thread ids in a queue.
    
    Test: Fix is verfied on gluster process, To test the patch followed below procedure
          Enable the client.ssl and server.ssl option on the volume
          Start the volume and count anon segment in pmap output for glusterd process
          pmap -x <glusterd-pid> | grep "\[ anon \]" | wc -l
          Stop the volume and check again count of anon segment it should not increase.
    
    Backport of commit 2ee48474be32f6ead2f3834677fee89d88348382
    
    > Signed-off-by: Mohit Agrawal <moagrawa>
    > Change-Id: Ib8f7ec7504ec8f6f74b45ce6719b6fb47f9fdc37
    > BUG: 1336508
    > Reviewed-on: http://review.gluster.org/14694
    > Smoke: Gluster Build System <jenkins.org>
    > Reviewed-by: Atin Mukherjee <amukherj>
    > CentOS-regression: Gluster Build System <jenkins.org>
    > NetBSD-regression: NetBSD Build System <jenkins.org>
    > Reviewed-by: Jeff Darcy <jdarcy>
    
    BUG: 1354395
    Change-Id: Ibdbbae508d9dda2fd36220a9b1e47f7776336929
    Signed-off-by: Mohit Agrawal <moagrawa>
    Reviewed-on: http://review.gluster.org/14891
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Reviewed-by: N Balachandran <nbalacha>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Jeff Darcy <jdarcy>

Comment 4 Niels de Vos 2016-08-12 09:47:17 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.8.2, please open a new bug report.

glusterfs-3.8.2 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://www.gluster.org/pipermail/announce/2016-August/000058.html
[2] https://www.gluster.org/pipermail/gluster-users/


Note You need to log in before you can comment on or make changes to this bug.