Skip to content

Microprofile recursive update exception when trying to use the Alias/DBSetting sources #7680

@qqmyers

Description

@qqmyers

In #7661, I tried to use the new Alias and DBSetting ConfigSources to support using a normal db setting aliased to an underlying microprofile variable for two cases. One appears to work fine, but the other was consistently giving me a recursive update exception. The problem occurred in #7661 prior to this commit, which includes the (hopefully) relevant part of the stack trace I was seeing in the commit notes.

At this point, I don't know if the problem was due to how I was using it, or if the problem is general- the only difference I can see between the setting that worked and the one that didn't is that the method retrieving the :InstallationName setting/associated mp variable is used in more places/possibly in async and regular code, but that could be a red-herring.

From the stack trace, it looked like the issue was related to the Alias source getting called recursively (it's getValue method calls ConfigProvider.getConfig.getOptionalValue() when you request the new variable (that is aliased to an old variable name served by the DbSettings source)). That could be a design issue (as far as I can tell, #7661 is the first use of this code outside of tests) so I though it was worth an issue. If it just innapropriate use, it might be worth some guidance in the dev docs for microprofile stuff.

At this point, the issue doesn't affect any code that is/will be merged, but it will probably appear again if we try to update other settings. I think #7661 prior to the commit above is ~working code (there are some changes after that commit needed to make everything work, but as of that commit Dataverse runs and nothing is broken except this issue, which can be triggered by publishing or reExporting via api), and I'm happy to answer questions if anything is unclear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions