wellington-junio / gitblit

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

Error in MailSystem seems to cause 100% CPU (GitBlit 1.6.0) #512

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I mis configured my E-Mail settings to use smtps on a non ssl secured line 
(requires TLS)
causing the following exception and a 100% CPU load:

2014-10-08 10:01:42 [ERROR] Failed to send message
javax.mail.MessagingException: Could not connect to SMTP host: 
smtp.office365.com, port: 587;
  nested exception is:
    javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1986)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:656)
    at javax.mail.Service.connect(Service.java:367)
    at javax.mail.Service.connect(Service.java:226)
    at javax.mail.Service.connect(Service.java:175)
    at javax.mail.Transport.send0(Transport.java:253)
    at javax.mail.Transport.send(Transport.java:124)
    at com.gitblit.service.MailService.run(MailService.java:275)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext 
connection?
    at sun.security.ssl.InputRecord.handleUnknownRecord(Unknown Source)
    at sun.security.ssl.InputRecord.read(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:532)
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:337)
    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:208)
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1950)
    ... 15 more

This exception was thrown in a loop for two days.
Only a restart fixed the issue.

Original issue reported on code.google.com by gabi.dev...@gmail.com on 8 Oct 2014 at 8:12

GoogleCodeExporter commented 9 years ago
Gitblit pushes messages into a queue and tries to send them to your SMTP server 
asynchronously from the triggering Gitblit event.  If the SMTP comms fail, the 
message remains in the queue until the SMTP comms succeed.  This is designed to 
prevent loss of important mail messages in the event of temporary downtime or 
mail server overload.

The real fix to this issue is ensuring that the mail server connection is 
properly configured.  I'm not sure what I can do to improve this.  Perhaps a 
test utility?  Do you have a recommendation?

Original comment by James.Mo...@gmail.com on 10 Oct 2014 at 12:49

GoogleCodeExporter commented 9 years ago
At last the E-Mail settings do not seem to be an issue. I completely deativated 
the mail system (by removing the settings). Still the process starts to hang 
after 1-2 Days with 100% CPU.
Apart from failed logins the log does not mention any errors.
Any suggestion on how I can get a hold of this error?

Original comment by gabi.dev...@gmail.com on 17 Oct 2014 at 2:55

GoogleCodeExporter commented 9 years ago
1. You could hookup VisualVM and inspect the running instance
2. If you are on *nix, you can "kill -QUIT process_id" to get a thread dump 
which can be analyzed by VisualVM

Have you tried disabling Lucene?

Original comment by James.Mo...@gmail.com on 17 Oct 2014 at 3:06

GoogleCodeExporter commented 9 years ago
Strangely sine I installed VisualVM, the server seems to run fine... (maybe 
scared I don't know...) I'll monitor the issue, but I think you can close this 
one.
Thanks anyway.

Original comment by gabi.dev...@gmail.com on 21 Oct 2014 at 9:50

GoogleCodeExporter commented 9 years ago
Ok, post back here if you collect more data.

Original comment by James.Mo...@gmail.com on 21 Oct 2014 at 2:05