Description
Slave::statusUpdate attempts to set the Source of the TaskStatus to either SOURCE_SLAVE or SOURCE_EXECUTOR:
https://github.com/apache/mesos/blob/0.21.0/src/slave/slave.cpp#L2222
TaskStatus status = update.status(); status.set_source(pid == UPID() ? TaskStatus::SOURCE_SLAVE : TaskStatus::SOURCE_EXECUTOR);
Unfortunately it make this change to a copy of the TaskStatus that's later discarded and the change is never saved to the parent StatusUpdate. This results in slave-forward()ed status updates that lack a proper source value.
The likely fix is that the set_source() update should be invoked on a TaskStatus* that's obtained via StatusUpdate.mutable_status() so that the new source is saved properly. It's not clear to me if StatusUpdate should be obtained via mutable_update().
It would also be helpful to have a unit test for this scenario.