@@ -81,7 +81,7 @@ func startGRPCPlugin(ctx context.Context, pluginName string, w *currentWorker, p
81
81
var errBi error
82
82
binary , errBi = w .client .PluginGetBinaryInfos (pluginName , currentOS , currentARCH )
83
83
if errBi != nil || binary == nil {
84
- return nil , sdk .WrapError (errBi , "Unable to get plugin binary infos... Aborting" )
84
+ return nil , sdk .WrapError (errBi , "plugin:%s Unable to get plugin binary infos... Aborting" , pluginName )
85
85
}
86
86
}
87
87
@@ -106,17 +106,17 @@ func startGRPCPlugin(ctx context.Context, pluginName string, w *currentWorker, p
106
106
log .Info ("Starting GRPC Plugin %s in dir %s" , binary .Name , dir )
107
107
fileContent , err := ioutil .ReadFile (path .Join (w .basedir , binary .GetName ()))
108
108
if err != nil {
109
- return nil , sdk .WrapError (err , "Unable to get plugin binary file... Aborting" )
109
+ return nil , sdk .WrapError (err , "plugin:%s unable to get plugin binary file... Aborting" , pluginName )
110
110
}
111
111
112
112
switch {
113
113
case sdk .IsTar (fileContent ):
114
114
if err := sdk .Untar (w .basedir , bytes .NewReader (fileContent )); err != nil {
115
- return nil , sdk .WrapError (err , "Unable to untar binary file" )
115
+ return nil , sdk .WrapError (err , "plugin:%s unable to untar binary file" , pluginName )
116
116
}
117
117
case sdk .IsGz (fileContent ):
118
118
if err := sdk .UntarGz (w .basedir , bytes .NewReader (fileContent )); err != nil {
119
- return nil , sdk .WrapError (err , "Unable to untarGz binary file" )
119
+ return nil , sdk .WrapError (err , "plugin:%s unable to untarGz binary file" , pluginName )
120
120
}
121
121
}
122
122
@@ -129,13 +129,13 @@ func startGRPCPlugin(ctx context.Context, pluginName string, w *currentWorker, p
129
129
cmd = path .Join (w .basedir , cmd )
130
130
_ , err = exec .LookPath (cmd )
131
131
if err != nil {
132
- return nil , sdk .WrapError (err , "Unable to start GRPC plugin, binary command not found." )
132
+ return nil , sdk .WrapError (err , "plugin:%s unable to start GRPC plugin, binary command not found." , pluginName )
133
133
}
134
134
}
135
135
args := append (binary .Entrypoints , binary .Args ... )
136
136
137
137
if err := grpcplugin .StartPlugin (ctx , dir , cmd , args , envs , mOut , mErr ); err != nil {
138
- return nil , sdk .WrapError (err , "Unable to start GRPC plugin... Aborting" )
138
+ return nil , sdk .WrapError (err , "plugin:%s unable to start GRPC plugin... Aborting" , pluginName )
139
139
}
140
140
log .Info ("GRPC Plugin %s started" , binary .Name )
141
141
@@ -149,15 +149,15 @@ func startGRPCPlugin(ctx context.Context, pluginName string, w *currentWorker, p
149
149
if err != nil && len (buff .String ()) > 0 {
150
150
buff .Reset ()
151
151
if time .Now ().Before (tsStart .Add (5 * time .Second )) {
152
- log .Warning ("Error on ReadByte, retry in 500ms..." )
152
+ log .Warning ("plugin:%s error on ReadByte, retry in 500ms..." , pluginName )
153
153
time .Sleep (500 * time .Millisecond )
154
154
continue
155
155
}
156
- log .Error ("error on ReadByte(len buff %d, content: %s): %v" , len (buff .String ()), buff .String (), err )
156
+ log .Error ("plugin:%s error on ReadByte(len buff %d, content: %s): %v" , pluginName , len (buff .String ()), buff .String (), err )
157
157
return nil , fmt .Errorf ("unable to get socket address from started binary" )
158
158
}
159
159
if err := buff .WriteByte (b ); err != nil {
160
- log .Error ("error on write byte: %v" , err )
160
+ log .Error ("plugin:%s error on write byte: %v" , pluginName , err )
161
161
break
162
162
}
163
163
if strings .HasSuffix (buff .String (), "is ready to accept new connection\n " ) {
0 commit comments