Skip to content

Commit

Permalink
[JENKINS-23256]
Browse files Browse the repository at this point in the history
Don't let a problem in MailAddressResolver affect the innocent caller
  • Loading branch information
kohsuke committed May 31, 2014
1 parent 2019ce6 commit c5497e0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/java/hudson/tasks/MailAddressResolver.java
Expand Up @@ -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);
}
}

Expand Down

3 comments on commit c5497e0

@oleg-nenashev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@imakowski
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.