CandyShop / gerrit

Automatically exported from code.google.com/p/gerrit
Apache License 2.0
1 stars 0 forks source link

Adding a reviewer is very slow #3396

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Affected Version: 2.11

What steps will reproduce the problem?
1. Add a reviewer :)

What is the expected output? What do you see instead?
It should be fast, but it is slow.

Please provide any additional information below.
Looks like email is sent synchronously.

Jstack trace:
Thread 73: (state = IN_NATIVE)
 - java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[], int, int, int) @bci=0 (Compiled frame; information may be imprecise)
 - java.net.SocketInputStream.read(byte[], int, int, int) @bci=87 (Compiled frame)
 - java.net.SocketInputStream.read(byte[], int, int) @bci=11 (Compiled frame)
 - sun.nio.cs.StreamDecoder.readBytes() @bci=135 (Compiled frame)
 - sun.nio.cs.StreamDecoder.implRead(char[], int, int) @bci=112 (Compiled frame)
 - sun.nio.cs.StreamDecoder.read(char[], int, int) @bci=180 (Compiled frame)
 - java.io.InputStreamReader.read(char[], int, int) @bci=7 (Compiled frame)
 - java.io.BufferedReader.fill() @bci=145 (Interpreted frame)
 - java.io.BufferedReader.readLine(boolean) @bci=44 (Compiled frame)
 - java.io.BufferedReader.readLine() @bci=2 (Compiled frame)
 - org.apache.commons.net.smtp.SMTP.__getReply() @bci=16, line=179 (Compiled frame)
 - org.apache.commons.net.smtp.SMTP.getReply() @bci=1, line=430 (Interpreted frame)
 - org.apache.commons.net.smtp.SMTPClient.completePendingCommand() @bci=1, line=178 (Interpreted frame)
 - com.google.gerrit.server.mail.SmtpEmailSender.send(com.google.gerrit.server.mail.Address, java.util.Collection, java.util.Map, java.lang.String) @bci=579, line=225 (Compiled frame)
 - com.google.gerrit.server.mail.OutgoingEmail.send() @bci=346, line=140 (Compiled frame)
 - com.google.gerrit.server.change.PostReviewers.emailReviewers(com.google.gerrit.reviewdb.client.Change, java.util.List) @bci=134, line=289 (Interpreted frame)
 - com.google.gerrit.server.change.PostReviewers.addReviewers(com.google.gerrit.server.change.ChangeResource, com.google.gerrit.server.change.ReviewerJson$PostResult, java.util.Map) @bci=265, line=258 (Interpreted frame)
 - com.google.gerrit.server.change.PostReviewers.putAccount(com.google.gerrit.server.change.ReviewerResource) @bci=43, line=158 (Interpreted frame)
 - com.google.gerrit.server.change.PostReviewers.apply(com.google.gerrit.server.change.ChangeResource, com.google.gerrit.extensions.api.changes.AddReviewerInput) @bci=44, line=140 (Interpreted frame)
 - com.google.gerrit.server.change.PostReviewers.apply(com.google.gerrit.extensions.restapi.RestResource, java.lang.Object) @bci=9, line=70 (Interpreted frame)
...

Original issue reported on code.google.com by org...@gmail.com on 28 May 2015 at 9:48

GoogleCodeExporter commented 9 years ago
Sending emails in the UI thread looks like a very bad idea.

With a slow SMTP server, every action takes too long: Adding reviewers, Submit, 
Abandon etc...

Please try to solve this.

Original comment by org...@gmail.com on 22 Jun 2015 at 6:03

GoogleCodeExporter commented 9 years ago
https://gerrit-review.googlesource.com/#/c/68849/

Original comment by david.pu...@sonymobile.com on 23 Jun 2015 at 8:08

GoogleCodeExporter commented 9 years ago

Original comment by david.pu...@sonymobile.com on 23 Jun 2015 at 8:22