[SERVER-46333] Server log output is incorrectly truncated in certain test environments Created: 22/Feb/20 Updated: 29/Oct/23 Resolved: 25/Feb/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 4.3.4 |
| Fix Version/s: | 4.3.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ian Boros | Assignee: | Henrik Edin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Dev Tools 2020-02-24 |
| Participants: |
| Description |
|
Certain test suites (like noPassthrough) are reponsible for starting their own mongods. As part of this, the shell started by resmoke is responsible for printing/redirecting the servers output. The logging mechanism responsible for this has truncation enabled by default, meaning a log line which is marked as "truncation disabled" (like below) may still ultimately get truncated when running under certain test suites.
A quick way to reproduce this is to add an absurdly long log message somewhere in the server and exercise it in a noPassthrough test. Here's a patch which adds one to the $planCacheStats agg stage (not a common code path). Base rev 2b61edc505e45acc7927aee40e4e8abeb99420cd.
Then run a test which exercises this code:
One would expect the entire string to be printed (including the word "remainder"), but only a prefix is printed.
I am using the following fix locally (so that I can continue other work). It might actually make sense to commit this (or something similar), since I doubt we use the ProgramOutputMultiplexer for anything besides testing, and we can enforce that log lines are truncated on mongod/mongos separately.
|
| Comments |
| Comment by Githook User [ 24/Feb/20 ] |
|
Author: {'name': 'Henrik Edin', 'username': 'henrikedin', 'email': 'henrik.edin@mongodb.com'}Message: Logs coming from mongod/mongos will be truncated already if they should be. |
| Comment by Ian Boros [ 22/Feb/20 ] |
|
NOTE: The way I ran into this (without modifying the server) was to run an operation that causes a crash. The backtrace that gets printed from this is often massive and would be subject to truncation from the shell. If you're having difficulty debugging a test/crash because the stack trace was truncated (and thus, cannot be symbolized) I would suggest applying the patch to shell_utils_launcher. |