<!-- 
RSS generated by JIRA (1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d) at Thu Feb 08 23:28:13 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>FOLIO Jira</title>
    <link>https://folio-org.atlassian.net</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>1001.0.0-SNAPSHOT</version>
        <build-number>100246</build-number>
        <build-date>07-02-2024</build-date>
    </build-info>

<item>
            <title>[FOLIO-3448] SPIKE: Prevent FolioExecutionContext from being initialized with wrong tenant id</title>
                <link>https://folio-org.atlassian.net/browse/FOLIO-3448</link>
                <project id="10290" key="FOLIO">FOLIO</project>
                    <description>&lt;p&gt;
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;MODEXPW-67&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/MODEXPW-67&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;FolioExecutionContext is initialized with wrong tenant id if Spring Batch job launches asynchronously in multi tenant cluster&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium&quot; /&gt;
            MODEXPW-67
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
 = &quot;FolioExecutionContext is initialized with wrong tenant id if Spring Batch job launches asynchronously in multi tenant cluster&quot;&lt;/p&gt;

&lt;p&gt;
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;MODEXPW-67&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/MODEXPW-67&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;FolioExecutionContext is initialized with wrong tenant id if Spring Batch job launches asynchronously in multi tenant cluster&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium&quot; /&gt;
            MODEXPW-67
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
 has fixed a wrong tenant id.&lt;/p&gt;

&lt;p&gt;How could it happen that a wrong tenant id was used?&lt;/p&gt;

&lt;p&gt;Is it possible that other code has similar tenant id issues?&lt;/p&gt;

&lt;p&gt;How can we prevent this from happening again? Can we make the library that handles tenant ids for spring bullet-proof? Can we publish a how-to or best practices on wiki.folio.org, dev.folio.org or the relevant spring github repositories?&lt;/p&gt;

&lt;p&gt;Tenant separation is a critical security feature that must be reliable.&lt;/p&gt;</description>
                <environment></environment>
        <key id="82261">FOLIO-3448</key>
            <summary>SPIKE: Prevent FolioExecutionContext from being initialized with wrong tenant id</summary>
                <type id="10008" iconUrl="https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10300?size=medium">Tech Debt</type>
                                            <priority id="10000" iconUrl="https://dev.folio.org/assets/jira-priority/jira-p1.svg">P1</priority>
                        <status id="6" iconUrl="https://folio-org.atlassian.net/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10003">Done</resolution>
                                                        <assignee accountid="5ee89462f7aa140abd82d11d">Julian Ladisch</assignee>
                                                                <reporter accountid="5ee89462f7aa140abd82d11d">Julian Ladisch</reporter>
                                    <labels>
                            <label>security</label>
                            <label>security-reviewed</label>
                    </labels>
                <created>Mon, 14 Mar 2022 17:36:53 +0000</created>
                <updated>Sun, 5 Mar 2023 11:06:49 +0000</updated>
                            <resolved>Thu, 2 Feb 2023 16:11:47 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>9</watches>
                                                                <comments>
                                                            <comment id="197458" author="5ee89462f7aa140abd82d11d" created="Mon, 14 Mar 2022 17:38:30 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=712020%3Aab17d861-5e82-4377-ad0b-0eaa18112edb&quot; class=&quot;user-hover&quot; rel=&quot;712020:ab17d861-5e82-4377-ad0b-0eaa18112edb&quot; data-account-id=&quot;712020:ab17d861-5e82-4377-ad0b-0eaa18112edb&quot; accountid=&quot;712020:ab17d861-5e82-4377-ad0b-0eaa18112edb&quot; rel=&quot;noreferrer&quot;&gt;Oleksandr Bozhko&lt;/a&gt; Can you advise how FOLIO can prevent a wrong tenant id in spring based modules?&lt;/p&gt;</comment>
                                                            <comment id="197461" author="557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d" created="Thu, 17 Mar 2022 15:29:09 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; class=&quot;user-hover&quot; rel=&quot;557058:003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; data-account-id=&quot;557058:003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; accountid=&quot;557058:003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; rel=&quot;noreferrer&quot;&gt;Oleksii Petrenko&lt;/a&gt;&#160;who from the Spring Way team should investigate this?&lt;/p&gt;</comment>
                                                            <comment id="197464" author="712020:d28f3303-d132-4a90-a1e4-02884a0fd949" created="Thu, 24 Mar 2022 15:21:10 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; class=&quot;user-hover&quot; rel=&quot;557058:003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; data-account-id=&quot;557058:003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; accountid=&quot;557058:003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; rel=&quot;noreferrer&quot;&gt;Oleksii Petrenko&lt;/a&gt; the security team would like to know if this issue is already in investigation somehow, thanks.&lt;/p&gt;</comment>
                                                            <comment id="197466" author="712020:ab17d861-5e82-4377-ad0b-0eaa18112edb" created="Thu, 24 Mar 2022 16:10:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5ee89462f7aa140abd82d11d&quot; class=&quot;user-hover&quot; rel=&quot;5ee89462f7aa140abd82d11d&quot; data-account-id=&quot;5ee89462f7aa140abd82d11d&quot; accountid=&quot;5ee89462f7aa140abd82d11d&quot; rel=&quot;noreferrer&quot;&gt;Julian Ladisch&lt;/a&gt; From what I understood during the work on 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;MODEXPW-67&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/MODEXPW-67&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;FolioExecutionContext is initialized with wrong tenant id if Spring Batch job launches asynchronously in multi tenant cluster&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium&quot; /&gt;
            MODEXPW-67
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
, this issue comes from the usage of &lt;a href=&quot;https://github.com/folio-org/mod-data-export-worker/blob/master/src/main/java/org/folio/dew/config/AsyncConfig.java&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;async logic here&lt;/a&gt; (mod-data-export-worker module) together with &lt;a href=&quot;https://github.com/folio-org/folio-spring-base/blob/d43ed3987e0d6f683c533c6d5f84b08770f8fcbf/src/main/java/org/folio/spring/scope/FolioExecutionScopeExecutionContextManager.java&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;this synchronization logic&lt;/a&gt; (folio-spring-base library). This requires more in-depth investigation.&lt;/p&gt;</comment>
                                                            <comment id="197469" author="557058:a8c797e5-5c61-47c6-baca-1a78467606c9" created="Tue, 19 Apr 2022 08:37:57 +0000"  >&lt;p&gt;Priority was increased to P1 because it is affect EDIFACT and BULK_EDIT schedulers in the mod-data-export-spring.&lt;br/&gt;
Related issues : &lt;a href=&quot;https://folio-org.atlassian.net/browse/MODEXPW-67&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://folio-org.atlassian.net/browse/MODEXPW-67&lt;/a&gt; and Issue fixed only for specific case, but not for all.&lt;/p&gt;</comment>
                                                            <comment id="197473" author="712020:d28f3303-d132-4a90-a1e4-02884a0fd949" created="Thu, 21 Apr 2022 15:44:11 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ab8e64633-1f7c-402d-9caf-9959a5ba5d0d&quot; class=&quot;user-hover&quot; rel=&quot;557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d&quot; data-account-id=&quot;557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d&quot; accountid=&quot;557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d&quot; rel=&quot;noreferrer&quot;&gt;Jakub Skoczen&lt;/a&gt; since this got a P1 the security team would like to ask you if you could expedite it&lt;/p&gt;</comment>
                                                            <comment id="197474" author="5cf6c546b87c300f36eb7b9a" created="Thu, 28 Apr 2022 15:31:38 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ab8e64633-1f7c-402d-9caf-9959a5ba5d0d&quot; class=&quot;user-hover&quot; rel=&quot;557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d&quot; data-account-id=&quot;557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d&quot; accountid=&quot;557058:b8e64633-1f7c-402d-9caf-9959a5ba5d0d&quot; rel=&quot;noreferrer&quot;&gt;Jakub Skoczen&lt;/a&gt; please see above.&lt;/p&gt;</comment>
                                                            <comment id="197476" author="5cf6c546b87c300f36eb7b9a" created="Thu, 12 May 2022 15:51:24 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; class=&quot;user-hover&quot; rel=&quot;557058:003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; data-account-id=&quot;557058:003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; accountid=&quot;557058:003b2b3f-c9ac-4207-96eb-21cdb3765e26&quot; rel=&quot;noreferrer&quot;&gt;Oleksii Petrenko&lt;/a&gt; &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5eb44b5a96bbcb0b8585c98d&quot; class=&quot;user-hover&quot; rel=&quot;5eb44b5a96bbcb0b8585c98d&quot; data-account-id=&quot;5eb44b5a96bbcb0b8585c98d&quot; accountid=&quot;5eb44b5a96bbcb0b8585c98d&quot; rel=&quot;noreferrer&quot;&gt;Pavlo Smahin&lt;/a&gt; what needs to happen to make progress on this?&lt;/p&gt;</comment>
                                                            <comment id="197477" author="70121:84bca0b8-4380-4d87-8a90-53e9133584f6" created="Thu, 2 Jun 2022 16:32:15 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5ee89462f7aa140abd82d11d&quot; class=&quot;user-hover&quot; rel=&quot;5ee89462f7aa140abd82d11d&quot; data-account-id=&quot;5ee89462f7aa140abd82d11d&quot; accountid=&quot;5ee89462f7aa140abd82d11d&quot; rel=&quot;noreferrer&quot;&gt;Julian Ladisch&lt;/a&gt; I added documentation to readme.md and Javadoc in corresponding java classes. This documentation addresses the following questions:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;How could it happen that a wrong tenant id was used?&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;Is it possible that other code has similar tenant id issues?&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;How can we prevent this from happening again? &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ade4eac47-6d4e-4b50-9c3c-4a82ed705e52&quot; class=&quot;user-hover&quot; rel=&quot;557058:de4eac47-6d4e-4b50-9c3c-4a82ed705e52&quot; data-account-id=&quot;557058:de4eac47-6d4e-4b50-9c3c-4a82ed705e52&quot; accountid=&quot;557058:de4eac47-6d4e-4b50-9c3c-4a82ed705e52&quot; rel=&quot;noreferrer&quot;&gt;Taras Spashchenko&lt;/a&gt; is working on wiki page for documentation of the Spring approach (e.g. Quick start guide, Guidelines etc.). In scope of these work the following question will be addressed:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Can we publish a how-to or best practices on wiki.folio.org, dev.folio.org or the relevant spring github repositories?&lt;/p&gt;&lt;/blockquote&gt;</comment>
                                                            <comment id="197480" author="5eb44b5a96bbcb0b8585c98d" created="Thu, 2 Jun 2022 17:03:30 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3A84bca0b8-4380-4d87-8a90-53e9133584f6&quot; class=&quot;user-hover&quot; rel=&quot;70121:84bca0b8-4380-4d87-8a90-53e9133584f6&quot; data-account-id=&quot;70121:84bca0b8-4380-4d87-8a90-53e9133584f6&quot; accountid=&quot;70121:84bca0b8-4380-4d87-8a90-53e9133584f6&quot; rel=&quot;noreferrer&quot;&gt;Mikhail Fokanov&lt;/a&gt;, please review issue 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;FOLSPRINGS-86&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/FOLSPRINGS-86&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;Enabling two tenants in parallel fails&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium&quot; /&gt;
            FOLSPRINGS-86
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
. There is also a problem with the execution context.&#160;&lt;/p&gt;</comment>
                                                            <comment id="197484" author="5ee89462f7aa140abd82d11d" created="Fri, 3 Jun 2022 09:29:45 +0000"  >&lt;p&gt;I&apos;ve created 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;FOLSPRINGS-58&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/FOLSPRINGS-58&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;Async FolioExecutionContext helper&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10309?size=medium&quot; /&gt;
            FOLSPRINGS-58
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
 &quot;Async FolioExecutionContext helper&quot; to make it as easy as possible to avoid this issue in new/changed code.&lt;/p&gt;</comment>
                                                            <comment id="197487" author="5ee89462f7aa140abd82d11d" created="Fri, 3 Jun 2022 09:37:30 +0000"  >&lt;blockquote&gt;&lt;p&gt;Is it possible that other code has similar tenant id issues?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;How can we ensure that all existing code that uses FolioExecutionContext and runs asynchronously properly sets and unsets the FolioExecutionContext?&lt;/p&gt;

&lt;p&gt;Do we need a code review Jira for each module that might be affected?&lt;/p&gt;</comment>
                                                            <comment id="197488" author="5ee89462f7aa140abd82d11d" created="Sun, 5 Jun 2022 11:15:51 +0000"  >&lt;p&gt;This GitHub search for beginFolioExecutionContext lists all modules and all code files that might be affected:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/search?q=org%3Afolio-org+beginFolioExecutionContext&amp;amp;type=code&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/search?q=org%3Afolio-org+beginFolioExecutionContext&amp;amp;type=code&lt;/a&gt;&lt;/p&gt;</comment>
                                                            <comment id="197491" author="70121:84bca0b8-4380-4d87-8a90-53e9133584f6" created="Wed, 8 Jun 2022 15:28:23 +0000"  >&lt;blockquote&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/search?q=org%3Afolio-org+beginFolioExecutionContext&amp;amp;type=code&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/search?q=org%3Afolio-org+beginFolioExecutionContext&amp;amp;type=code&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5ee89462f7aa140abd82d11d&quot; class=&quot;user-hover&quot; rel=&quot;5ee89462f7aa140abd82d11d&quot; data-account-id=&quot;5ee89462f7aa140abd82d11d&quot; accountid=&quot;5ee89462f7aa140abd82d11d&quot; rel=&quot;noreferrer&quot;&gt;Julian Ladisch&lt;/a&gt; I analyzed all the code that can be found by it. It is used in a right way everywhere.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;How can we ensure that all existing code that uses FolioExecutionContext and runs asynchronously properly sets and unsets the FolioExecutionContext? Do we need a code review Jira for each module that might be affected?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I arranged a meeting for this Friday in order to explain all the details to Epam Team leads. I will collect questions and outcome of this meeting and then I will arrange a meeting for other community Team leads. There was a gap in the documentation regarding the FolioExecutionContext , that is why this mistake was done by developers.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5ee89462f7aa140abd82d11d&quot; class=&quot;user-hover&quot; rel=&quot;5ee89462f7aa140abd82d11d&quot; data-account-id=&quot;5ee89462f7aa140abd82d11d&quot; accountid=&quot;5ee89462f7aa140abd82d11d&quot; rel=&quot;noreferrer&quot;&gt;Julian Ladisch&lt;/a&gt; What additional actions would you suggest?&lt;/p&gt;</comment>
                                                            <comment id="197494" author="5ee89462f7aa140abd82d11d" created="Thu, 9 Jun 2022 20:00:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/folio-org/mod-data-export-spring/blob/v1.3.5/src/main/java/org/folio/des/config/FolioExecutionContextHelper.java#L50-L73&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/mod-data-export-spring/blob/v1.3.5/src/main/java/org/folio/des/config/FolioExecutionContextHelper.java#L50-L73&lt;/a&gt;&lt;br/&gt;
FolioExecutionContextHelper.initScope() sets the FolioExecutionContext, but there isn&apos;t an endFolioExecutionContext() when the task is finished.&lt;/p&gt;</comment>
                                                            <comment id="197496" author="5ee89462f7aa140abd82d11d" created="Thu, 9 Jun 2022 20:04:58 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/folio-org/mod-data-export-spring/blob/v1.3.5/src/main/java/org/folio/des/config/kafka/KafkaConsumerInterceptor.java#L33&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/mod-data-export-spring/blob/v1.3.5/src/main/java/org/folio/des/config/kafka/KafkaConsumerInterceptor.java#L33&lt;/a&gt;&lt;br/&gt;
sets the FolioExecutionContext but there isn&apos;t an endFolioExecutionContext() when the task is finished.&lt;/p&gt;</comment>
                                                            <comment id="197499" author="5ee89462f7aa140abd82d11d" created="Thu, 9 Jun 2022 20:07:25 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/folio-org/mod-data-export-worker/blob/v1.3.5/src/main/java/org/folio/dew/config/kafka/KafkaConsumerInterceptor.java#L34&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/mod-data-export-worker/blob/v1.3.5/src/main/java/org/folio/dew/config/kafka/KafkaConsumerInterceptor.java#L34&lt;/a&gt;&lt;br/&gt;
sets the FolioExecutionContext but there isn&apos;t an endFolioExecutionContext() when the task is finished.&lt;/p&gt;</comment>
                                                            <comment id="197502" author="5ee89462f7aa140abd82d11d" created="Thu, 9 Jun 2022 20:16:30 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/folio-org/mod-remote-storage/blob/v1.5.0/src/main/java/org/folio/rs/service/AccessionQueueService.java#L97&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/mod-remote-storage/blob/v1.5.0/src/main/java/org/folio/rs/service/AccessionQueueService.java#L97&lt;/a&gt;&lt;br/&gt;
sets the FolioExecutionContext but there isn&apos;t an endFolioExecutionContext() when the task is finished.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/folio-org/mod-remote-storage/blob/v1.5.0/src/main/java/org/folio/rs/integration/KafkaMessageListener.java#L27&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/mod-remote-storage/blob/v1.5.0/src/main/java/org/folio/rs/integration/KafkaMessageListener.java#L27&lt;/a&gt;&lt;br/&gt;
has two instances of FolioExecutionContext; one in the private variable, one set by processAccessionQueueRecord(events) in the thread.&lt;/p&gt;
</comment>
                                                            <comment id="197504" author="5ee89462f7aa140abd82d11d" created="Thu, 9 Jun 2022 20:26:02 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/folio-org/mod-data-export-worker/pull/217/files#diff-f1d0438cfd3ca0dc21fbf1e14570cecd7322e0179e3ff153e0d41350cadf43c9R96&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/mod-data-export-worker/pull/217/files#diff-f1d0438cfd3ca0dc21fbf1e14570cecd7322e0179e3ff153e0d41350cadf43c9R96&lt;/a&gt;&lt;br/&gt;
sets the FolioExecutionContext but there isn&apos;t an endFolioExecutionContext() when the task is finished.&lt;/p&gt;</comment>
                                                            <comment id="197507" author="70121:84bca0b8-4380-4d87-8a90-53e9133584f6" created="Thu, 9 Jun 2022 20:35:42 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5ee89462f7aa140abd82d11d&quot; class=&quot;user-hover&quot; rel=&quot;5ee89462f7aa140abd82d11d&quot; data-account-id=&quot;5ee89462f7aa140abd82d11d&quot; accountid=&quot;5ee89462f7aa140abd82d11d&quot; rel=&quot;noreferrer&quot;&gt;Julian Ladisch&lt;/a&gt;, after you comment about endFolioExecutionContext() I added this information about it to readme.md, but actually calling &lt;em&gt;endFolioExecutionContext() is not mandatory&lt;/em&gt; because when some one process/request will be executed, the headers will be rewritten with the new ones from the process/request (after beginFolioExecutionContext() call).&lt;br/&gt;
My comment &quot;&lt;em&gt;I analyzed all the code that can be found by it. It is used in a right way everywhere.&lt;/em&gt;&quot; was just about it. This mentioned code will work well without calling of endFolioExecutionContext() (e.g. it is not a bug in the code).&lt;/p&gt;</comment>
                                                            <comment id="197510" author="5ee89462f7aa140abd82d11d" created="Fri, 10 Jun 2022 10:00:23 +0000"  >&lt;p&gt;It&apos;s a bug in the code when the tentant id (in FolioExecutionContext) is read from thread local but it hasn&apos;t been set for the current task.&lt;br/&gt;
This bug should fail the unit test.&lt;br/&gt;
The unit test fails if the previous task removes the tenant id from thread local.&lt;br/&gt;
Therefore the tenant id should always been removed.&lt;br/&gt;
Not removing the tenant id is not a bug but makes it possible that a bug in other code that runs next on the same thread goes unnoticed.&lt;/p&gt;</comment>
                                                            <comment id="197513" author="70121:84bca0b8-4380-4d87-8a90-53e9133584f6" created="Wed, 15 Jun 2022 08:17:11 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5ee89462f7aa140abd82d11d&quot; class=&quot;user-hover&quot; rel=&quot;5ee89462f7aa140abd82d11d&quot; data-account-id=&quot;5ee89462f7aa140abd82d11d&quot; accountid=&quot;5ee89462f7aa140abd82d11d&quot; rel=&quot;noreferrer&quot;&gt;Julian Ladisch&lt;/a&gt; OK. I will ask Firebird (&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=712020%3A6a686c16-9faf-499e-b5ea-d5e640ebd2a3&quot; class=&quot;user-hover&quot; rel=&quot;712020:6a686c16-9faf-499e-b5ea-d5e640ebd2a3&quot; data-account-id=&quot;712020:6a686c16-9faf-499e-b5ea-d5e640ebd2a3&quot; accountid=&quot;712020:6a686c16-9faf-499e-b5ea-d5e640ebd2a3&quot; rel=&quot;noreferrer&quot;&gt;Siarhei Charniak&lt;/a&gt;, &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=63519767d66d8108a1226c09&quot; class=&quot;user-hover&quot; rel=&quot;63519767d66d8108a1226c09&quot; data-account-id=&quot;63519767d66d8108a1226c09&quot; accountid=&quot;63519767d66d8108a1226c09&quot; rel=&quot;noreferrer&quot;&gt;Viachaslau Khandramai&lt;/a&gt;) to fix the code, that you mentioned. I created a draft story: &lt;a href=&quot;https://folio-org.atlassian.net/browse/MODEXPW-163&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://folio-org.atlassian.net/browse/MODEXPW-163&lt;/a&gt;&lt;/p&gt;</comment>
                                                            <comment id="197604" author="5ee89462f7aa140abd82d11d" created="Tue, 21 Jun 2022 15:55:38 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3A84bca0b8-4380-4d87-8a90-53e9133584f6&quot; class=&quot;user-hover&quot; rel=&quot;70121:84bca0b8-4380-4d87-8a90-53e9133584f6&quot; data-account-id=&quot;70121:84bca0b8-4380-4d87-8a90-53e9133584f6&quot; accountid=&quot;70121:84bca0b8-4380-4d87-8a90-53e9133584f6&quot; rel=&quot;noreferrer&quot;&gt;Mikhail Fokanov&lt;/a&gt; Thanks for tje Jira to improve the MODEXPW code.&lt;/p&gt;

&lt;p&gt;Is there agreement that the FolioExecutionContextSetter should be merged and that it should replace&#160; beginFolioExecutionContext() and endFolioExecutionContext()?&lt;/p&gt;

&lt;p&gt;
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;FOLSPRINGS-58&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/FOLSPRINGS-58&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;Async FolioExecutionContext helper&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10309?size=medium&quot; /&gt;
            FOLSPRINGS-58
        &lt;/a&gt;
                                                    &lt;span class=&quot;aui-lozenge aui-lozenge-subtle aui-lozenge-success jira-macro-single-issue-export-pdf&quot;&gt;Closed&lt;/span&gt;
            &lt;/span&gt;
 = &#160;&lt;a href=&quot;https://github.com/folio-org/folio-spring-base/pull/56/files&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/folio-spring-base/pull/56/files&lt;/a&gt;&lt;/p&gt;</comment>
                                                            <comment id="197606" author="70121:84bca0b8-4380-4d87-8a90-53e9133584f6" created="Thu, 30 Jun 2022 07:24:02 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5ee89462f7aa140abd82d11d&quot; class=&quot;user-hover&quot; rel=&quot;5ee89462f7aa140abd82d11d&quot; data-account-id=&quot;5ee89462f7aa140abd82d11d&quot; accountid=&quot;5ee89462f7aa140abd82d11d&quot; rel=&quot;noreferrer&quot;&gt;Julian Ladisch&lt;/a&gt;. We had a call with Epam guys regarding FolioExecutionContext usage. We agreed that in each case if the context is opened, it must be closed. Guys are ready to fix the issues that you highlighted in comments to this jira on June 9th as soon as they can (e.g. this week).&lt;br/&gt;
In order to fix them we have the following plan:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;To avoid breaking changes before the release, in Morning glory guys will call the existing &quot;endFolioExecutionContext&quot; method, where it is needed. It is tiny amount of work.&lt;/li&gt;
	&lt;li&gt;In the next release we will release new (5.0) version of Spring-Folio-Base and all modules will migrate to Autocloseable FolioExecutionContextSetter.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                                                            <comment id="197609" author="5ee89462f7aa140abd82d11d" created="Thu, 30 Jun 2022 08:48:36 +0000"  >&lt;p&gt;Good plan, thanks!&lt;/p&gt;</comment>
                                                            <comment id="197612" author="5cf6c546b87c300f36eb7b9a" created="Thu, 15 Sep 2022 15:21:16 +0000"  >&lt;p&gt;Waiting to merge this so it doesn&apos;t end up in Morning Glory (a workaround is used in that release), but does end up in Nolana.&lt;/p&gt;</comment>
                                                            <comment id="197615" author="5cf6c546b87c300f36eb7b9a" created="Thu, 2 Feb 2023 16:11:47 +0000"  >&lt;p&gt;See continuation story&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="35862">FOLSPRINGS-86</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Continues</name>
                                                                <inwardlinks description="is continued by">
                                        <issuelink>
            <issuekey id="31141">MODEXPW-163</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="35838">FOLSPRINGS-95</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="31171">MODEXPW-375</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="35814">FOLSPRINGS-58</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="38931">MODEBSNET-58</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="34412">MODEXPS-123</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="31148">MODEXPW-173</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="73525">MODRS-130</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="31051">MODEXPW-144</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="31002">MODEXPW-67</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10000" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummarycf">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10057" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Development Team</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10181"><![CDATA[Spring Force]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10063" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>PO Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10106" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>RCA Group</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10367"><![CDATA[TBD]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10019" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i04b4y:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10020" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10024" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>[CHART] Date of First Response</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 17 Mar 2022 15:29:09 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10025" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>[CHART] Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>