Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned this change is risky. It looks like the reason this limit exists is to prevent going over the binder IPC limit. It would seem like increasing the trace size would increase the chances of that occurring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the binder maximum size was 1 MB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right but I think it is possible that multiple stack traces will get sent in one binder transaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any value here is risky, in any direction we go. Decreasing max means shorter stacktraces => Espresso is less useful. Increasing the max means more risk of hitting the binder max.
What if this didn't already have a value today, how would we pick a value? 65,536 bytes is super conservative, but 131,072 bytes is also very conservative. To send multiple stacktraces at the same time you'd need to run tests in parallel and you'd need them to fail and you'd need long stacktraces for each. Isn't that a bit far fetched?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am under the impression that multiple stack traces can get sent in one transaction even under normal conditions. Even with this trace limit in place, there are user complaints about binder size transaction errors.
#269
Long term we hope to move away from using binder to communicate test results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be hard to impose a limit on the aggregated size rather than individuals? If the cumulative stack trace size is big in one binder transaction, then stop adding more stack traces. This way, the common usefulness will increase (developer running a single test, tying to reproduce an issue and not seeing stack currently), while other cases will have more data too, but with some stacks fully missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposed change is targeting
InstrumentationResultPrinter
, notOrchestrationResultPrinter
/OrchestrationXmlTestRunListener
which the linked issues IMO clearly shows has issues.Also
OrchestrationResultPrinter
/OrchestrationXmlTestRunListener
do not impose any limits on the MAX_TRACE_SIZE although theOrchestrationResultPrinter
-javadoc states:(maybe they actually should)
And they have no dependency on
InstrumentationResultPrinter
from what I can tell.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah cool. Thanks for all the investigation everyone. There have been reports of non-orchestrator-using users hitting binder transaction issues as well, but I suspect they were making heavy use of metrics. This change sounds reasonable but I'd like to do a bit more investigation with those users. I'm pretty slammed this week but will report back next week.