@@ -52,8 +52,8 @@ type PythonFunctionDescriptor struct {
5252}
5353
5454// FunctionDescriptor is a union wrapper for various function descriptor types.
55- //
56- // TODO(jwj): Add validation for the "oneof" logic in eventserver.go if necessary .
55+ // Ray's proto guarantees that the following three function descriptors hold an "oneof" relationship.
56+ // Ref: https://github.com/ray-project/ray/blob/36be009ae360788550e541d81806493f52963730/src/ray/protobuf/common.proto#L157-L164 .
5757type FunctionDescriptor struct {
5858 JavaFunctionDescriptor * JavaFunctionDescriptor `json:"javaFunctionDescriptor,omitempty"`
5959 PythonFunctionDescriptor * PythonFunctionDescriptor `json:"pythonFunctionDescriptor,omitempty"`
@@ -117,7 +117,6 @@ type Task struct {
117117 Language Language `json:"language,omitempty"`
118118 // For TASK_DEFINITION_EVENT, only TaskFunc and TaskName are populated.
119119 // For ACTOR_TASK_DEFINITION_EVENT, only ActorFunc and ActorTaskName are populated.
120- // TODO(jwj): Need a validation function to make the "oneof" relationship more explicit.
121120 // It might be better to define separate structs or TaskDefinition interface with custom JSON marshal/unmarshal logic.
122121 TaskFunc * FunctionDescriptor `json:"taskFunc,omitempty"`
123122 ActorFunc * FunctionDescriptor `json:"actorFunc,omitempty"`
@@ -334,6 +333,11 @@ func (t Task) DeepCopy() Task {
334333 }
335334 }
336335
336+ if t .CallSite != nil {
337+ callSite := * t .CallSite
338+ cp .CallSite = & callSite
339+ }
340+
337341 if len (t .LabelSelector ) > 0 {
338342 cp .LabelSelector = make (map [string ]string , len (t .LabelSelector ))
339343 for k , v := range t .LabelSelector {
@@ -352,8 +356,8 @@ func (t Task) DeepCopy() Task {
352356 }
353357
354358 if t .IsDebuggerPaused != nil {
355- cp . IsDebuggerPaused = new ( bool )
356- * cp .IsDebuggerPaused = * t . IsDebuggerPaused
359+ isDebuggerPaused := * t . IsDebuggerPaused
360+ cp .IsDebuggerPaused = & isDebuggerPaused
357361 }
358362
359363 if t .ActorReprName != nil {
0 commit comments