Skip to content

Commit 804a703

Browse files
CopilotReubenBondCopilot
authored
Mark [Unordered] as [Obsolete] (#9815)
* Initial plan * Mark UnorderedAttribute as obsolete and remove internal usages Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com> * Apply suggestion from @ReubenBond * Finish the job * Update src/Orleans.Core.Abstractions/Concurrency/GrainAttributeConcurrency.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ReubenBond <203839+ReubenBond@users.noreply.github.com> Co-authored-by: Reuben Bond <reuben.bond@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7dac9bf commit 804a703

File tree

8 files changed

+6
-73
lines changed

8 files changed

+6
-73
lines changed

src/Orleans.Core.Abstractions/Concurrency/GrainAttributeConcurrency.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ public void Populate(IServiceProvider services, Type grainClass, GrainType grain
4343
/// The Unordered attribute is used to mark grain interface in which the delivery order of
4444
/// messages is not significant.
4545
/// </summary>
46+
/// <remarks>
47+
/// This attribute has no effect and it may be removed in a future release.
48+
/// </remarks>
4649
[AttributeUsage(AttributeTargets.Interface)]
50+
[Obsolete("Message ordering is not guaranteed regardless of whether this attribute is used. This attribute has no effect.")]
4751
public sealed class UnorderedAttribute : Attribute
4852
{
4953
}

src/Orleans.Core/SystemTargetInterfaces/IMembershipTable.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ public interface IMembershipTable
104104
/// <summary>
105105
/// Membership table interface for system target based implementation.
106106
/// </summary>
107-
[Unordered]
108107
public interface IMembershipTableSystemTarget : IMembershipTable, ISystemTarget
109108
{
110109
}

src/Orleans.Reminders/SystemTargetInterfaces/IReminderTable.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ Task StartAsync(CancellationToken cancellationToken = default)
8787
/// <summary>
8888
/// Reminder table interface for grain based implementation.
8989
/// </summary>
90-
[Unordered]
9190
internal interface IReminderTableGrain : IGrainWithIntegerKey
9291
{
9392
Task<ReminderTableData> ReadRows(GrainId grainId);

test/Grains/TestGrainInterfaces/CodegenTestInterfaces.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ public interface ISomeGrain : IGrainWithIntegerKey
4242
Task Do(Outsider o);
4343
}
4444

45-
[Unordered]
46-
public interface ISomeGrainWithInvocationOptions : IGrainWithIntegerKey
47-
{
48-
[AlwaysInterleave]
49-
Task AlwaysInterleave();
50-
}
51-
5245
public interface ISerializationGenerationGrain : IGrainWithIntegerKey
5346
{
5447
Task<object> RoundTripObject(object input);

test/Grains/TestGrainInterfaces/IReentrancyGrain.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ public interface IMayInterleaveInstancedPredicateGrain : IGrainWithIntegerKey
5050
Task SetSelf(IMayInterleaveInstancedPredicateGrain self);
5151
}
5252

53-
[Unordered]
54-
public interface IUnorderedNonReentrantGrain : IGrainWithIntegerKey
55-
{
56-
Task<string> One();
57-
58-
Task<string> Two();
59-
60-
Task SetSelf(IUnorderedNonReentrantGrain self);
61-
}
62-
6353
public interface IReentrantSelfManagedGrain : IGrainWithIntegerKey
6454
{
6555
Task<int> GetCounter();

test/Grains/TestGrains/ReentrantGrain.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -239,26 +239,6 @@ public Task SetSelf(IMayInterleaveInstancedPredicateGrain self)
239239
}
240240
}
241241

242-
public class UnorderedNonRentrantGrain : Grain, IUnorderedNonReentrantGrain
243-
{
244-
private IUnorderedNonReentrantGrain Self { get; set; }
245-
246-
public Task<string> One()
247-
{
248-
return Task.FromResult("one");
249-
}
250-
251-
public async Task<string> Two()
252-
{
253-
return await Self.One() + " two";
254-
}
255-
256-
public Task SetSelf(IUnorderedNonReentrantGrain self)
257-
{
258-
Self = self;
259-
return Task.CompletedTask;
260-
}
261-
}
262242
[Reentrant]
263243
public class ReentrantSelfManagedGrain1 : Grain, IReentrantSelfManagedGrain
264244
{

test/TesterInternal/MessageScheduling/DisabledCallChainReentrancyTestRunner.cs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -90,31 +90,5 @@ public void NonReentrantGrain_WithMayInterleaveInstancedPredicate_WhenPredicateR
9090
}
9191
this.logger.LogInformation("Reentrancy NonReentrantGrain_WithMayInterleaveInstancedPredicate_WhenPredicateReturnsFalse Test finished OK.");
9292
}
93-
94-
public void UnorderedNonReentrantGrain(bool performDeadlockDetection)
95-
{
96-
IUnorderedNonReentrantGrain unonreentrant = this.grainFactory.GetGrain<IUnorderedNonReentrantGrain>(OrleansTestingBase.GetRandomGrainId());
97-
unonreentrant.SetSelf(unonreentrant).Wait();
98-
bool timeout = false;
99-
bool deadlock = false;
100-
try
101-
{
102-
timeout = !unonreentrant.Two().Wait(2000);
103-
}
104-
catch (Exception exc)
105-
{
106-
Assert.Fail($"Unexpected exception {exc.Message}: {exc.StackTrace}");
107-
}
108-
if (performDeadlockDetection)
109-
{
110-
Assert.True(deadlock, "Non-reentrant grain should deadlock");
111-
}
112-
else
113-
{
114-
Assert.True(timeout, "Non-reentrant grain should timeout");
115-
}
116-
117-
this.logger.LogInformation("Reentrancy UnorderedNonReentrantGrain Test finished OK.");
118-
}
11993
}
120-
}
94+
}

test/TesterInternal/MessageScheduling/DisabledCallChainReentrancyTests.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,5 @@ public void NonReentrantGrain_WithMayInterleaveInstancedPredicate_WhenPredicateR
4141
{
4242
this.runner.NonReentrantGrain_WithMayInterleaveInstancedPredicate_WhenPredicateReturnsFalse(false);
4343
}
44-
45-
[Fact, TestCategory("Functional"), TestCategory("Tasks"), TestCategory("Reentrancy")]
46-
public void UnorderedNonReentrantGrain()
47-
{
48-
this.runner.UnorderedNonReentrantGrain(false);
49-
}
5044
}
51-
}
45+
}

0 commit comments

Comments
 (0)