Merge branch 'stable-2.13'

* stable-2.13:
  Update 2.13.1 release notes
  Catch exceptions from StreamEvents JSON Serialization
  Set version to 2.13.1
  Add 2.13.1 release notes

Change-Id: Ida2a689a71c4f7b94a057bd53cc47c8329d9b015
This commit is contained in:
Hugo Arès
2016-09-23 16:02:53 +02:00
3 changed files with 37 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
= Release notes for Gerrit 2.13.1
Gerrit 2.13.1 is now available:
link:https://gerrit-releases.storage.googleapis.com/gerrit-2.13.1.war[
https://gerrit-releases.storage.googleapis.com/gerrit-2.13.1.war]
== Schema Upgrade
There are no schema changes from link:ReleaseNotes-2.13.html[2.13].
== Bug Fixes
* link:https://bugs.chromium.org/p/gerrit/issues/detail?id=4618[Issue 4618]:
Fix internal server error after online reindexing completed.
* Fix internal server error when cloning from slaves and not all refs are
visible.
* Fix JSON deserialization error causing stream event client to no longer receive
events.

View File

@@ -2,6 +2,7 @@
[[s2_13]] [[s2_13]]
== Version 2.13.x == Version 2.13.x
* link:ReleaseNotes-2.13.1.html[2.13.1]
* link:ReleaseNotes-2.13.html[2.13] * link:ReleaseNotes-2.13.html[2.13]
[[s2_12]] [[s2_12]]

View File

@@ -40,6 +40,8 @@ import com.google.inject.Inject;
import org.apache.sshd.server.Environment; import org.apache.sshd.server.Environment;
import org.kohsuke.args4j.Option; import org.kohsuke.args4j.Option;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
@@ -51,6 +53,9 @@ import java.util.concurrent.LinkedBlockingQueue;
@RequiresCapability(GlobalCapability.STREAM_EVENTS) @RequiresCapability(GlobalCapability.STREAM_EVENTS)
@CommandMetaData(name = "stream-events", description = "Monitor events occurring in real time") @CommandMetaData(name = "stream-events", description = "Monitor events occurring in real time")
final class StreamEvents extends BaseCommand { final class StreamEvents extends BaseCommand {
private static final Logger log =
LoggerFactory.getLogger(StreamEvents.class);
/** Maximum number of events that may be queued up for each connection. */ /** Maximum number of events that may be queued up for each connection. */
private static final int MAX_EVENTS = 128; private static final int MAX_EVENTS = 128;
@@ -262,9 +267,16 @@ final class StreamEvents extends BaseCommand {
} }
private void write(final Object message) { private void write(final Object message) {
final String msg = gson.toJson(message) + "\n"; String msg = null;
synchronized (stdout) { try {
stdout.print(msg); msg = gson.toJson(message) + "\n";
} catch (Exception e) {
log.warn("Could not deserialize the msg: ", e);
}
if (msg != null) {
synchronized (stdout) {
stdout.print(msg);
}
} }
} }