Forum Discussion

voonsionglum's avatar
voonsionglum
Brass Contributor
Nov 29, 2021

Root bot, skill bot and scaling

Hi,

 

We need help with scaling.

 

Problem statement: With 2 instances of root bot running, a skill bot invocation is unable to return results reliably to the root bot.

 

With 1 instance of the root bot and 1 instance of the skill bot, everything works as expected.

 

We configured the root bot with "Scale Out" and "Manual Scale" to set the instance count to 2.  When we repeat the interaction, we see that the skill response is not getting returned reliably.  

 

In a successful scenario where the user's skill response is routed back to the root bot that the user interacted with, the user gets the skill results.

 

 

In a failed scenario, the user's skill response was routed to the root bot instance that the user did not interact with.  Hence, the results are lost.

 

How do we ensure that the skill results are returned to the correct root bot instance?

 

We reviewed the "Skills overview" documentation at https://docs.microsoft.com/en-us/azure/bot-service/skills-conceptual?view=azure-bot-service-4.0, but it does not mention anything about scaling and persistence.

 

We had thought that the lack of persistence could be due to the bots' conversation state.  However, our root bot is currently storing all conversation states in DB.  Since both instances are using the same DB connection string, they should have access to the same conversation states in the DB.

 

Thank You

 

 

 

 

 

  • Slacked2737's avatar
    Slacked2737
    Dec 14, 2022

    voonsionglum 

    We had James check his data and found this. See if it helps. In the root bot:

     

    • Double check and be 100% sure that you're using the SkillConversationIdFactory that is a part of the MS chatbot framework (NOT one that you may have created). It should have a IStorage constructor parameter that lets you pass in whatever storage you want to use to persist ids used with skills communication. You probably need to use the class that is given to you in the chatbot framework. (i.e. SkillConversationIdFactory that inherits from"Microsoft.Bot.Builder.Skills.SkillConversationIdFactoryBase")

     

    • For the IStorage object used by SkillConversationIdFactory, If you are using some kind of in-memory only storage, (i.e. A ConcurrentDictionary or other MemoryStorage type object), that might be a problem. The code in SkillConversationIdFactory might not be persisting the conversation/skill ID lookup data (needed to talk with skills) into a place that other apps can read.

     

    I have found some old MS examples that give a "demo" of how to use skills and shows a SkillConversationIdFactory that uses in-memory storage...which of course won't scale or work across different apps.

     

    https://learn.microsoft.com/en-us/dotnet/api/microsoft.bot.builder.skills.skillconversationidfactory?view=botbuilder-dotnet-stable

     

     

Resources