[SERVER-37700] Remove white-space from use in setThreadName Created: 22/Oct/18 Updated: 29/Oct/23 Resolved: 08/Jan/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.7 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Benjamin Caimano (Inactive) | Assignee: | Jonathan Ma |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Service Arch 2018-12-31, Service Arch 2019-01-14 |
| Participants: |
| Description |
|
Less robust programs may parse the proc filesystem incorrectly if there is whitespace in thread names. I propose that we debug assert that there is no whitespace in the name inside the function setThreadName. As of now, I've found thread names containing spaces in:
|
| Comments |
| Comment by Benjamin Caimano (Inactive) [ 08/Jan/19 ] |
|
As an additional note, we found situations where clients were able to set the thread name. We cannot effectively prevent the setting of thread names with white space in that case. |
| Comment by Jonathan Ma [ 08/Jan/19 ] |
|
Ticket has been adjusted to only scrubbing whitespaces from existing thread names. |
| Comment by Githook User [ 08/Jan/19 ] |
|
Author: {'email': 'jonathan.ma@mongodb.com', 'name': 'Jonathan Ma'}Message: |
| Comment by Benjamin Caimano (Inactive) [ 21/Dec/18 ] |
|
For reference, thread names are set via setThreadName. These also tend to get set via this fill in. This change is desirable because it's a trivial way to make mongodb easier to understand for tools that parse procfs data since it tends to be space separated. |
| Comment by Benjamin Caimano (Inactive) [ 22/Oct/18 ] |
|
I think there might be precedent for hyphens instead? (Not sure it matters, just commenting.) |
| Comment by Sara Williamson [ 22/Oct/18 ] |
|
The plan here would be to change whitespace to underscores. |