On 3 February 2016 at 13:53, Sam Ruby <[email protected]> wrote: > On Tue, Feb 2, 2016 at 11:25 AM, Sam Ruby <[email protected]> wrote: >> >> ... which means that the following returned an empty list: >> >> https://github.com/apache/whimsy/blob/master/lib/whimsy/asf/ldap.rb#L129 >> >> And that code looks problematic. The first thing I would suggest >> would be to remove the begin/rescue/return []/end lines, allowing >> whatever LDAP error occurs to bubble up. It may turn out that there >> are errors that may be worth retrying (e.g. LDAP server goes down, try >> reconnecting). If so, a much more focused rescue clause could be >> re-added. >> >>> Unfortunately the Whimsy log files are not kept for any length of time. >> >> There wouldn't be anything in the logs. If, however, the exception >> weren't captured, that would be logged, and that result would trigger >> an email. > > Here's the log: > > HTTP/1.1 400 public_json ldap-people > ["/srv/whimsy/lib/whimsy/asf/ldap.rb:129:in `search2': Time limit > exceeded (LDAP::ResultError)", "\tfrom > /srv/whimsy/lib/whimsy/asf/ldap.rb:129:in `search_one'", "\tfrom > /srv/whimsy/lib/whimsy/asf/ldap.rb:262:in `preload'", "\tfrom > roster/public_ldap_people.rb:25:in `<main>'"] > > So... one LDAP server (my guess: ldaps://ldap2-us-west.apache.org:636) > times out.
We could / should log the server along with the message. I'll have a look at doing that. > Unfortunately, the exception raised isn't very specific, so the only > way to recover from it would be to look at the exception text. Or just log and retry regardless of the actual error. > Recovery could be trying another LDAP server. Yes. There should be a retry limit. > Meanwhile, this exception should have prevented an empty people file, > the only affect (other than the alert) would be that an update made > during that time would not be reflected until the next time the cron > job fired. > > This could also have been the cause for empty email addresses in the > reminder script. Agreed. > - Sam Ruby
