Describe ITS change events without resolving the patch set

EventHandler.toString() described a patch set event by resolving
PatchSetEvent#patchSet. That supplier is not cheap because it needs to
open the repository, and it is also unsafe because it can throw an
exception when it cannot find a patch set.

A worker thread's name is set using task.toString() before the task is
invoked. This is done in Gerrit core's WorkQueue and ideally should be
fixed to protect its executor against this. An exception during
toString() causes the worker thread to never run the task. With the
current implementation of async event processing, this results in a
leaked semaphore permit because the task never runs and releaseIfReady()
ends up not being called from ThrottledTask.run().

This change updates EventHandler.toString() to describe the event
directly from its fields. Although this omits the patch set ref from the
thread description, it now includes the change key to correlate a queue
entry with a change. It also eliminates the need to open the repository.

An event without a patch set still fails in PropertyExtractor, which
resolves the same supplier while doing the actual work. However, that
failure is caught and logged, allowing the permit to be safely released.

Change-Id: I2fd7d20e5a819bf6fc9d3808c0946c4096f190cb
1 file changed