Skip to content
Permalink
Browse files

[JENKINS-23256]

Don't let a problem in MailAddressResolver affect the innocent caller
  • Loading branch information...
kohsuke committed May 31, 2014
1 parent 2019ce6 commit c5497e08f35e18ae5a37ace9139a651363d8658e
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/main/java/hudson/tasks/MailAddressResolver.java
@@ -118,12 +118,16 @@ public static String resolve(User u) {
}

for (MailAddressResolver r : all()) {
String email = r.findMailAddressFor(u);
if(email!=null) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(r+" resolved "+u.getId()+" to "+email);
try {
String email = r.findMailAddressFor(u);
if(email!=null) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(r+" resolved "+u.getId()+" to "+email);
}
return email;
}
return email;
} catch (Exception e) {
LOGGER.log(Level.WARNING, r+" failed to resolve "+u+". Ignoring and moving on",e);
}
}

3 comments on commit c5497e0

@oleg-nenashev

This comment has been minimized.

Copy link
Member

replied Jun 1, 2014

@kohsuke
Are you going to add any new functionality?
If no, I'm going to release the plugin

@imakowski

This comment has been minimized.

Copy link

replied Jun 4, 2014

Will this fix performance issue in ext-mail plugin? for now we have issues that sending emails can take over 20 minutes after build

@oleg-nenashev

This comment has been minimized.

Copy link
Member

replied Jun 4, 2014

@imakowski
Your issue is related to slow MailAddressResolvers in plugins.
#12 should resolve your issue if you use plugins like LDAP.

Please sign in to comment.
You can’t perform that action at this time.