commit | bf1ab92e73b22372f83287c6d1270594eadbbe58 | [log] [tgz] |
---|---|---|
author | Matthias Sohn <matthias.sohn@sap.com> | Wed Mar 08 18:06:32 2023 +0100 |
committer | Matthias Sohn <matthias.sohn@sap.com> | Thu Mar 09 13:45:54 2023 +0100 |
tree | 09eab4cc54ca42bfb6bec313c4079125102c1687 | |
parent | c69d4b8bb67e94e978acdbed4697a7a7008d6926 [diff] |
TaskThunk#run: ignore SshChannelClosedException As recommended by Thomas Wolf in [1] ignore SshChannelClosedException when flushing the task's output and error streams. JGit commands like UploadPack flush these streams already. When TaskThunk tries to flush them again SshChannelClosedException is thrown and leads to an internal server error: [SSH git-upload-pack /xxx.git (xxx)] ERROR com.google.gerrit.sshd.BaseCommand : Internal server error (user xxx account xx) during git-upload-pack '/xxx.git' org.apache.sshd.common.channel.exception.SshChannelClosedException: write(ChannelOutputStream SSH_MSG_CHANNEL_DATA) len=17 - channel already closed at org.apache.sshd.common.channel.ChannelOutputStream.write(ChannelOutputStream.java:132) at org.eclipse.jgit.transport.UploadPack$ResponseBufferedOutputStream.write(UploadPack.java:2495) at org.eclipse.jgit.transport.SideBandOutputStream.writeBuffer(SideBandOutputStream.java:141) at org.eclipse.jgit.transport.SideBandOutputStream.flushBuffer(SideBandOutputStream.java:94) at org.eclipse.jgit.transport.SideBandOutputStream.flush(SideBandOutputStream.java:100) at org.eclipse.jgit.transport.PacketLineOut.writePacket(PacketLineOut.java:157) at org.eclipse.jgit.transport.PacketLineOut.writePacket(PacketLineOut.java:133) at org.eclipse.jgit.transport.PacketLineOut.writeString(PacketLineOut.java:119) at org.eclipse.jgit.transport.RefAdvertiser$PacketLineOutRefAdvertiser.writeOne(RefAdvertiser.java:125) at org.eclipse.jgit.transport.RefAdvertiser.send(RefAdvertiser.java:306) at org.eclipse.jgit.transport.UploadPack.lsRefsV2(UploadPack.java:1133) at org.eclipse.jgit.transport.UploadPack.serveOneCommandV2(UploadPack.java:1347) at org.eclipse.jgit.transport.UploadPack.serviceV2(UploadPack.java:1398) at org.eclipse.jgit.transport.UploadPack.uploadWithExceptionPropagation(UploadPack.java:859) at org.eclipse.jgit.transport.UploadPack.upload(UploadPack.java:769) at com.google.gerrit.sshd.commands.Upload.runImpl(Upload.java:101) at com.google.gerrit.sshd.AbstractGitCommand.service(AbstractGitCommand.java:109) at com.google.gerrit.sshd.AbstractGitCommand$1.run(AbstractGitCommand.java:74) at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:491) at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:113) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:612) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) org.apache.sshd.common.channel.exception.SshChannelClosedException: write SSH_MSG_CHANNEL_DATA) len=4 - channel already closed at org.apache.sshd.common.channel.ChannelOutputStream.write(ChannelOutputStream.java:132) at org.eclipse.jgit.transport.UploadPack$ResponseBufferedOutputStream.write(UploadPack.java:2495) at org.eclipse.jgit.transport.PacketLineOut.writePacket(PacketLineOut.java:157) at org.eclipse.jgit.transport.PacketLineOut.writePacket(PacketLineOut.java:133) at org.eclipse.jgit.transport.PacketLineOut.writeString(PacketLineOut.java:119) at org.eclipse.jgit.transport.UploadPack$PackProtocolErrorWriter.writeError(UploadPack.java:2536) at org.eclipse.jgit.transport.UploadPack.upload(UploadPack.java:787) ... [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=565854 Release-Notes: Fix internal server error caused by double flush in BaseCommand.TaskThunk Change-Id: I66a650c30228bcbab2d9fb01449010dda53faba9
Gerrit is a code review and project management tool for Git based projects.
Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
Gerrit is the work of hundreds of contributors. We appreciate your help!
Please read the contribution guidelines.
Note that we do not accept Pull Requests via the Github mirror.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Bazel and run the following:
git clone --recurse-submodules https://gerrit.googlesource.com/gerrit cd gerrit && bazel build release
The instruction how to configure GerritForge/BinTray repositories is here
On Debian/Ubuntu run:
apt-get update & apt-get install gerrit=<version>-<release>
NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.
On CentOS/RedHat run:
yum clean all && yum install gerrit-<version>[-<release>]
On Fedora run:
dnf clean all && dnf install gerrit-<version>[-<release>]
Docker images of Gerrit are available on DockerHub
To run a CentOS 8 based Gerrit image:
docker run -p 8080:8080 gerritcodereview/gerrit[:version]-centos8
To run a Ubuntu 20.04 based Gerrit image:
docker run -p 8080:8080 gerritcodereview/gerrit[:version]-ubuntu20
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.