-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Limit CS Update Task Description Size #79443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
5e16e8d
c4309e9
dc041cc
596e200
1f3e3ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,14 +131,38 @@ void runIfNotProcessed(BatchedTask updateTask) { | |
| } | ||
|
|
||
| if (toExecute.isEmpty() == false) { | ||
| final String tasksSummary = processTasksBySource.entrySet().stream().map(entry -> { | ||
| String tasks = updateTask.describeTasks(entry.getValue()); | ||
| return tasks.isEmpty() ? entry.getKey() : entry.getKey() + "[" + tasks + "]"; | ||
| }).reduce((s1, s2) -> s1 + ", " + s2).orElse(""); | ||
| run(updateTask.batchingKey, toExecute, buildTasksDescription(updateTask, toExecute, processTasksBySource)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| run(updateTask.batchingKey, toExecute, tasksSummary); | ||
| private String buildTasksDescription(BatchedTask updateTask, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise here I think?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here it's a little less fun to use the general string builder than in the other case because I think it'd be nice to have the overall task count?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But we have this weird setup here where we have the tasks grouped by source so the counting will only work out correctly if the source is different for each task? I kinda liked having that level of detail on the counts for debugging still.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see we use How about either just appending |
||
| List<BatchedTask> toExecute, | ||
| Map<String, List<BatchedTask>> processTasksBySource) { | ||
| final StringBuilder output = new StringBuilder(); | ||
| int len = 0; | ||
| int count = 0; | ||
| int taskCount = 0; | ||
| for (Map.Entry<String, List<BatchedTask>> entry : processTasksBySource.entrySet()) { | ||
| String tasks = updateTask.describeTasks(entry.getValue()); | ||
| final String description = tasks.isEmpty() ? entry.getKey() : entry.getKey() + "[" + tasks + "]"; | ||
| if (len > 0) { | ||
| output.append(", "); | ||
| } | ||
| len += description.length(); | ||
| count++; | ||
| taskCount += entry.getValue().size(); | ||
| output.append(description); | ||
| // don't render additional task descriptions beyond 8k chars | ||
| if (len > 8 * 1024) { | ||
| break; | ||
| } | ||
| } | ||
| final int remaining = processTasksBySource.size() - count; | ||
| if (remaining > 0) { | ||
| output.append(", ").append(toExecute.size() - taskCount).append(" additional tasks for ").append(remaining).append(" sources"); | ||
| } | ||
| return output.toString(); | ||
| } | ||
|
|
||
| /** | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.