-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] fix static analized high priority issues #2391
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- v1.4.51
- v1.4.0-beta1
- v.1.3.12
- v1.3.11
- v1.3.10
- v1.3.9
- v1.3.8
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2
- v1.1.3
- 1.5.35
- 1.5.34
- 1.5.33
- 1.5.32
- 1.5.31
- 1.5.30
- 1.5.29
- 1.5.28
- 1.5.28-beta1
- 1.5.27.1
- 1.5.27
- 1.5.27-beta2
- 1.5.27-beta1
- 1.5.26
- 1.5.25
- 1.5.24
- 1.5.23
- 1.5.22
- 1.5.21
- 1.5.20
- 1.5.19
- 1.5.18
- 1.5.17.1
- 1.5.17
- 1.5.16
- 1.5.15
- 1.5.14
- 1.5.13
- 1.5.13-beta1
- 1.5.12
- 1.5.11
- 1.5.10
- 1.5.9
- 1.5.8
- 1.5.7
- 1.5.6
- 1.5.5
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.5.0-beta6
- 1.5.0-beta5
- 1.5.0-beta4
- 1.5.0-beta3
- 1.5.0-beta2
- 1.5.0-beta1
- 1.5.0-alpha4
- 1.5.0-alpha3
- 1.5.0-alpha2
- 1.5.0-alpha1
- 1.4.50
- 1.4.49
- 1.4.49-beta1
- 1.4.48
- 1.4.47
- 1.4.46
- 1.4.45
- 1.4.44
- 1.4.43
- 1.4.42
- 1.4.41
- 1.4.40
- 1.4.39
- 1.4.38
- 1.4.37
- 1.4.36
- 1.4.35
- 1.4.34
- 1.4.33
- 1.4.32
- 1.4.31
- 1.4.30
- 1.4.29
- 1.4.28
- 1.4.27
- 1.4.26
- 1.4.25
- 1.4.24
- 1.4.23
- 1.4.22
- 1.4.21
- 1.4.21-beta1
- 1.4.20
- 1.4.19
- 1.4.18
- 1.4.17
- 1.4.16
- 1.4.15
- 1.4.14
- 1.4.13
- 1.4.12
- 1.4.11
- 1.4.10
- 1.4.9
- 1.4.8
- 1.4.7
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.1-rc3
- 1.4.1-rc2
- 1.4.1-rc1
- 1.4.0-beta4
- 1.4.0-beta3
- 1.4.0-beta2
- 1.3.19
- 1.3.18
- 1.3.17
- 1.3.16
- 1.3.15
- 1.3.14
- 1.3.13
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,7 @@ public void Enter(string name) | |
/// </summary> | ||
public void Enter(TimeSpan timeout, ImmutableList<string> names) | ||
{ | ||
_system.Log.Debug("entering barriers {0}", names.Aggregate((a,b) => a = ", " + b)); | ||
_system.Log.Debug("entering barriers {0}", names.Aggregate((a, b) => "(" + a + "," + b + ")")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'a' is always rewritten in method, and more clear debug message |
||
var stop = Deadline.Now + timeout; | ||
|
||
foreach (var name in names) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -730,7 +730,6 @@ protected void Accepting() | |
_endpoints.MarkAsQuarantined(gotuid.RemoteAddress, gotuid.Uid, | ||
Deadline.Now + _settings.QuarantineDuration); | ||
_eventPublisher.NotifyListeners(new QuarantinedEvent(gotuid.RemoteAddress, gotuid.Uid)); | ||
Context.Stop(pass.Endpoint); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if policy is WasGated Context.Stop(pass.Endpoint) will cause null reference exception There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NICE catch. |
||
else | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,31 +59,29 @@ private void FaultRecreate(Exception cause) | |
if (System.Settings.DebugLifecycle) | ||
Publish(new Debug(_self.Path.ToString(), failedActor.GetType(), "Restarting")); | ||
|
||
if (failedActor != null) | ||
{ | ||
var optionalMessage = CurrentMessage; | ||
var optionalMessage = CurrentMessage; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. failedActor is _actor, _actor already checked on null |
||
|
||
try | ||
{ | ||
// if the actor fails in preRestart, we can do nothing but log it: it’s best-effort | ||
failedActor.AroundPreRestart(cause, optionalMessage); | ||
try | ||
{ | ||
// if the actor fails in preRestart, we can do nothing but log it: it’s best-effort | ||
|
||
failedActor.AroundPreRestart(cause, optionalMessage); | ||
|
||
// run actor pre-incarnation plugin pipeline | ||
var pipeline = _systemImpl.ActorPipelineResolver.ResolvePipeline(failedActor.GetType()); | ||
pipeline.BeforeActorIncarnated(failedActor, this); | ||
} | ||
catch (Exception e) | ||
{ | ||
HandleNonFatalOrInterruptedException(() => | ||
{ | ||
var ex = new PreRestartException(_self, e, cause, optionalMessage); | ||
Publish(new Error(ex, _self.Path.ToString(), failedActor.GetType(), e.Message)); | ||
}); | ||
} | ||
finally | ||
// run actor pre-incarnation plugin pipeline | ||
var pipeline = _systemImpl.ActorPipelineResolver.ResolvePipeline(failedActor.GetType()); | ||
pipeline.BeforeActorIncarnated(failedActor, this); | ||
} | ||
catch (Exception e) | ||
{ | ||
HandleNonFatalOrInterruptedException(() => | ||
{ | ||
ClearActor(_actor); | ||
} | ||
var ex = new PreRestartException(_self, e, cause, optionalMessage); | ||
Publish(new Error(ex, _self.Path.ToString(), failedActor.GetType(), e.Message)); | ||
}); | ||
} | ||
finally | ||
{ | ||
ClearActor(_actor); | ||
} | ||
|
||
global::System.Diagnostics.Debug.Assert(Mailbox.IsSuspended(), "Mailbox must be suspended during restart, status=" + Mailbox.CurrentStatus()); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,18 +40,9 @@ public static Task<T> Ask<T>(this ICanTell self, object message, TimeSpan? timeo | |
if (provider == null) | ||
throw new ArgumentException("Unable to resolve the target Provider", nameof(self)); | ||
|
||
ResolveReplyTo(); | ||
return Ask(self, message, provider, timeout).CastTask<object, T>(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the same as do nothing |
||
} | ||
|
||
internal static IActorRef ResolveReplyTo() | ||
{ | ||
if (ActorCell.Current != null) | ||
return ActorCell.Current.Self; | ||
|
||
return null; | ||
} | ||
|
||
internal static IActorRefProvider ResolveProvider(ICanTell self) | ||
{ | ||
if (ActorCell.Current != null) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum can't be null