cb_set_thread_name() broken on all Linux platforms

Description

the cb_set_thread_name() function was added in 4.0 to assist in understanding memcached's behaviour by allowing all threads to be given a name.

Unfortunately a patch to solve a SuSE build break caused it to accidentally become a no-op on Linux platforms, meaning the thread names are not reported - see http://review.couchbase.org/51711

The issue is that cb_pthreads.c doesn't include platform/internal_config.h, so HAVE_PTHREAD_SETNAME_NP is always undefined.

Components

Affects versions

Fix versions

Labels

Environment

None

Link to Log File, atop/blg, CBCollectInfo, Core dump

None

Release Notes Description

None

Activity

Eric Cooper November 23, 2015 at 7:08 PM

top -H did not show memcache for some reason but top -H -p <memcache pid> did:

top - 11:07:39 up 11 days, 22:38, 1 user, load average: 0.00, 0.01, 0.02
Tasks: 9 total, 0 running, 9 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.8%us, 0.9%sy, 0.0%ni, 98.2%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 3973948k total, 982636k used, 2991312k free, 179744k buffers
Swap: 10829820k total, 7448k used, 10822372k free, 418256k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
11005 couchbas 20 0 166m 4816 3048 S 0.0 0.1 0:00.15 mc:listener
11015 couchbas 20 0 166m 4816 3048 S 0.0 0.1 0:00.00 mc:check stdin
11016 couchbas 20 0 166m 4816 3048 S 0.0 0.1 0:00.00 mc:file_logger
11017 couchbas 20 0 166m 4816 3048 S 0.0 0.1 0:00.00 mc:auditd
11018 couchbas 20 0 166m 4816 3048 S 0.0 0.1 0:00.00 mc:worker 0
11019 couchbas 20 0 166m 4816 3048 S 0.0 0.1 0:00.15 mc:worker 1
11020 couchbas 20 0 166m 4816 3048 S 0.0 0.1 0:00.00 mc:worker 2
11021 couchbas 20 0 166m 4816 3048 S 0.0 0.1 0:00.00 mc:worker 3
11022 couchbas 20 0 166m 4816 3048 S 0.0 0.1 0:00.00 mc:worker 4

Dave Rigby November 2, 2015 at 1:59 PM

@Raju, @Ritam - we already have a unit test for this in master: http://review.couchbase.org/56050

Dave Rigby October 30, 2015 at 3:13 PM

@DaveF: Ah yes looks like Trond already merged it

Dave Finlay October 30, 2015 at 3:00 PM

Approved in 4.1 (actually it's already in because it's merged and the build tracks branch tip in 4.1)

David Haikney October 30, 2015 at 2:49 PM

This needs to go in 4.1.0 - this was intended to be working in 4.0

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Is this a Regression?

Yes

Triage

Untriaged

Operating System

Ubuntu 64-bit

Sprint

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created October 30, 2015 at 12:14 PM
Updated November 23, 2015 at 7:08 PM
Resolved October 30, 2015 at 3:14 PM
Instabug