dotnet / dotnet/orleans

System.ArgumentException: streamId if grain-id-type missmatch stream-id-Type

Open
#9,282 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.9k
Forks
2.1k
Avg merge
14h 42m
Merged PRs (30d)
354

Description

- Assuming you have a grain A with **IGrainWithIntegerKey** and a stream B where the **stream-id** is a guid.
If you use the ImplicitStreamSubscription-Attribute on the grain A you get a exception:

``
System.ArgumentException: streamId
at Orleans.Streams.DefaultStreamIdMapper.GetIntegerKey(StreamId streamId, Boolean includeNamespaceInGrainId) in /_/src/Orleans.Streaming/Core/DefaultStreamIdMapper.cs:line 66
at Orleans.Streams.DefaultStreamIdMapper.GetGrainKeyId(GrainBindings grainBindings, StreamId streamId) in /_/src/Orleans.Streaming/Core/DefaultStreamIdMapper.cs:line 46
at Orleans.Streams.ImplicitStreamSubscriberTable.StreamSubscriber.GetGrainId(QualifiedStreamId streamId) in /_/src/Orleans.Streaming/PubSub/ImplicitStreamSubscriberTable.cs:line 258
at Orleans.Streams.ImplicitStreamSubscriberTable.GetImplicitSubscribers(QualifiedStreamId streamId, IInternalGrainFactory grainFactory) in /_/src/Orleans.Streaming/PubSub/ImplicitStreamSubscriberTable.cs:line 124
at Orleans.Streams.ImplicitStreamPubSub.RegisterProducer(QualifiedStreamId streamId, GrainId streamProducer) in /_/src/Orleans.Streaming/PubSub/ImplicitStreamPubSub.cs:line 31
at Orleans.Streams.StreamPubSubImpl.RegisterProducer(QualifiedStreamId streamId, GrainId streamProducer) in /_/src/Orleans.Streaming/PubSub/StreamPubSubImpl.cs:line 34
at Orleans.Streams.PersistentStreamPullingAgent.PubsubRegisterProducer(IStreamPubSub pubSub, QualifiedStreamId streamId, GrainId meAsStreamProducer, ILogger logger) in /_/src/Orleans.Streaming/PersistentStreams/PersistentStreamPullingAgent.cs:line 802
``
- Version: 8.2.0

- In version 3 of orelans it had worked.

- If this is the expected behavior:

Maybe the [documentation](https://learn.microsoft.com/en-us/dotnet/orleans/streaming/streams-programming-apis?pivots=orleans-7-0)
could be more clear here. And the exception could be more direct to the problem.

Contributor guide

Open the contributing guide

Research direction

Start with the reported call path in src/Orleans.Streaming/Core/DefaultStreamIdMapper.cs and the implicit subscription handling in src/Orleans.Streaming/PubSub/ImplicitStreamSubscriberTable.cs. Reproduce the IGrainWithIntegerKey and GUID stream-id combination, then determine the expected behavior and make the resulting guidance or error message clear, including the linked streaming documentation if appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.