Make sure the "Object too large..." error is printed to the client

When receiving and object larger than receive.maxObjectSizeLimit, Gerrit
relied on the JGits ReceivePack.receive to print out the error message.
However, JGit didn't print out this error always. Sometimes it would
print the error and throw UnpackException and sometimes it would only
throw the UnpackException leaving the user without proper explanation
why the object was rejected.

With this change we print the error from Gerrit.

Change-Id: I5165ce0be86c91abf0ad02b5f7d8d2b1000dc493
Make async logging buffer size configurable.

Introduce the core.asyncLogginBufferSize parameter as size of the buffer
to store logging events for asynchronous logging.

Putting a larger value can protect threads from stalling when the
AsyncAppender threads are not fast enough to consume the logging events
from the buffer. It also protects from loosing log entries in this case.

In addition, instead of expected thread stall when the logging buffer is
full there is a bad side effect where an AsyncAppender-Dispatcher thread
dies which then causes all NioProcessor threads to block on
AsyncAppender.append method. Finally Gerrit stops responding on SSH
requests. The reason for AsyncAppender-Dispatcher thread death is that
it tries to discard a set of unprocessed logging events from the buffer
but throws a NPE because of trying to compute hash value on the logger
parameter of the LogginEvent which is set to null from Gerrit.  We
should probably also try to make our logging events discardable. This is
not part of this change.

Change-Id: I3fe97a7a0827293a385bf6ccb46ed2f4af53b674
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Display proper error if file diff fails because content is too large

File diffs can only be displayed for files that do not exceed a threshold
for big files. If a file is larger, building the patch script fails with
org.eclipse.jgit.errors.LargeObjectException. Since
org.eclipse.jgit.errors.LargeObjectException is a RuntimeException the
GerritJsonServlet treats it as internal failure and as result the web ui
just shows 'Internal Server Error'.

This change ensures that a proper error message is displayed in this case.
This is done by wrapping the org.eclipse.jgit.errors.LargeObjectException
into a normal Exception.

Change-Id: I708957a2fadfce88f3c0c6a433343274ae169b6f
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Make logging events discardable, prevent NPE in AsyncAppender thread.

In rare but possible case when an AsyncAppender-Dispatcher thread tries
to discard queued logging events, it throws a NPE and the thread dies.
Soon after that, as the async logging queue gets full the threads start
blocking on the queue when they try to log something.

The NPE was caused by passing null for the logger parameter of
LoggingEvent instances created by SshLog and HttpLog. To fix the issue
we simply pass the already existing logger instance to the constructor
of LoggingEvent.

Change-Id: If213a63a80895483b0a32dd4a172cb6ac464ecf7
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Merge "Make async logging buffer size configurable." into stable-2.4
Merge "Display proper error if file diff fails because content is too large" into stable-2.4
Gerrit 2.4.1 ReleaseNotes

Change-Id: I251cb93d8747467c78db7982d4376ef9f4b5d82c
Merge tag 'v2.4.1'

gerrit 2.4.1

* tag 'v2.4.1':
  Gerrit 2.4.1 ReleaseNotes
  Make logging events discardable, prevent NPE in AsyncAppender thread.
  Display proper error if file diff fails because content is too large
  Make async logging buffer size configurable.
  Make sure the "Object too large..." error is printed to the client

Conflicts:
	gerrit-httpd/src/main/java/com/google/gerrit/httpd/rpc/patch/PatchScriptFactory.java

Change-Id: Ifd6b7ba9d3b099576fab97d7d739beef7949d045
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Add owner username to gerrit query command.

Change-Id: Iec0a2adfdf6c4a2dd9a94dc327b68f836b59da59
Merge "Add owner username to gerrit query command."
Revert "Display the approval table on the Publish Comments screen."

This reverts commit 3fc98f99b4bcb87be6c3d37ab92014ee68e1c627.
The display was buggy and listed users as "Anonymous Coward"
even though they had a Full Name supplied in the Account. I
don't have time to debug this myself, but users are unhappy
the table is confusing/useless with everyone being called
an Anonymous Coward so the change goes out.

Bug: issue 1383
CC: Joe Hansche <jhansche@myyearbook.com>
Change-Id: Ibe9f70bc001df4b3a04ee2eb4dfa194f75e5b3f0