<!-- 
RSS generated by JIRA (1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d) at Fri Feb 09 00:32:37 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>[UXPROD-3515] Concurrent Check-outs via Self-check do not check for patron item limits</title>
                <link>https://folio-org.atlassian.net/browse/UXPROD-3515</link>
                <project id="10000" key="UXPROD">UX Product</project>
                    <description>&lt;p&gt;Possible bug in circulation: &lt;a href=&quot;https://github.com/folio-org/mod-circulation/blob/v22.1.3/src/main/java/org/folio/circulation/resources/CheckOutByBarcodeResource.java#L125-L140&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/mod-circulation/blob/v22.1.3/src/main/java/org/folio/circulation/resources/CheckOutByBarcodeResource.java#L125-L140&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The selfcheck machine connects to FOLIO through SIP2 and checks out multiple items to the same patron at the same time (each checkout message does not wait for the processing result, and multiple checkout messages are sent at the same time).&lt;br/&gt;
 It might exceed the maximum number of items that the patron is allowed to loan. For example, the maximum number of books a patron can checkout is 15 items, and the self-check machine sends 20 checkout requests almost simultaneously, it turns out that all the 20 books are successfully checked out.&lt;/p&gt;

&lt;p&gt;It is normal to valid the circulation rules when checkout item one by one in CheckOutByBarcodeResource.java.&lt;br/&gt;
 Once the concurrency occurs, folio will only check the circulation rules of current checkout, instead of checking all the concurrent checkout, which may exceed the limit.&lt;/p&gt;

&lt;p&gt;This is caused by a race condition: After refuseWhenItemLimitIsReached is called (line 125) many other operations take place before createLoan is called (line 140): &lt;a href=&quot;https://github.com/folio-org/mod-circulation/blob/v22.1.3/src/main/java/org/folio/circulation/resources/CheckOutByBarcodeResource.java#L125-L140&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/mod-circulation/blob/v22.1.3/src/main/java/org/folio/circulation/resources/CheckOutByBarcodeResource.java#L125-L140&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="12244">UXPROD-3515</key>
            <summary>Concurrent Check-outs via Self-check do not check for patron item limits</summary>
                <type id="10002" iconUrl="https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10322?size=medium">New Feature</type>
                            <parent id="13652">UXPROD-789</parent>
                                    <priority id="10002" iconUrl="https://dev.folio.org/assets/jira-priority/jira-p3.svg">P3</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="62e94faeb5b801a9afeeccc1">Tim Auger</assignee>
                                                                <reporter accountid="557058:dea2f026-f9d7-42e0-af50-31b385c95e3e">Cheryl Malmborg</reporter>
                                    <labels>
                    </labels>
                <created>Mon, 15 Nov 2021 17:03:44 +0000</created>
                <updated>Thu, 28 Sep 2023 10:57:11 +0000</updated>
                            <resolved>Thu, 28 Sep 2023 10:57:11 +0000</resolved>
                                                    <fixVersion>Poppy (R2 2023)</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>13</watches>
                                                                <comments>
                                                            <comment id="14241" author="557058:dea2f026-f9d7-42e0-af50-31b385c95e3e" created="Mon, 15 Nov 2021 17:12:45 +0000"  >&lt;p&gt;I&apos;ve asked Tiewei Liu to add specifics about the self-check software they are using.  Several libraries using self-check have not seen this problem.&lt;/p&gt;</comment>
                                                            <comment id="14243" author="63e2a2771b13d42998e4e706" created="Mon, 15 Nov 2021 21:44:07 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Adea2f026-f9d7-42e0-af50-31b385c95e3e&quot; class=&quot;user-hover&quot; rel=&quot;557058:dea2f026-f9d7-42e0-af50-31b385c95e3e&quot; data-account-id=&quot;557058:dea2f026-f9d7-42e0-af50-31b385c95e3e&quot; accountid=&quot;557058:dea2f026-f9d7-42e0-af50-31b385c95e3e&quot; rel=&quot;noreferrer&quot;&gt;Cheryl Malmborg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is the intention behind raising this bug? Is it intended that this be prioritised and worked on?&lt;/p&gt;</comment>
                                                            <comment id="14245" author="5ff60d224d2179006ebd8a15" created="Mon, 15 Nov 2021 21:59:55 +0000"  >&lt;p&gt;Marc, this is a go-live blocker for Shanghai Library. So it needs to be solved as soon as possible (by December).&#160;&lt;/p&gt;

&lt;p&gt;Cheryl, thank you for creating the ticket! Gang Zhou will add the specifics about the self-check software.&lt;/p&gt;</comment>
                                                            <comment id="14247" author="557058:dea2f026-f9d7-42e0-af50-31b385c95e3e" created="Mon, 15 Nov 2021 22:35:10 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=63e2a2771b13d42998e4e706&quot; class=&quot;user-hover&quot; rel=&quot;63e2a2771b13d42998e4e706&quot; data-account-id=&quot;63e2a2771b13d42998e4e706&quot; accountid=&quot;63e2a2771b13d42998e4e706&quot; rel=&quot;noreferrer&quot;&gt;Marc Johnson&lt;/a&gt; I am not sure how to characterize this issue.  There seems to be an incompatibility between the self-checkout system Shanghai is using and folio processing.  I know nothing about their self-check software.&lt;/p&gt;

&lt;p&gt;I think the first thing would be a clarification of how folio is keeping track of how many loans a patron has checked out.  Are the patron&apos;s loans re-queried with each item checked out or does the module increment a session counter?&lt;/p&gt;</comment>
                                                            <comment id="14250" author="70121:c2a5f0f6-9d45-4202-ad88-c57f05316346" created="Tue, 16 Nov 2021 04:00:55 +0000"  >&lt;p&gt;Slefcheck machines are from Shanghai RFID, Seaever,&#160;Bibliotheca&lt;/p&gt;</comment>
                                                            <comment id="14252" author="63e2a2771b13d42998e4e706" created="Tue, 16 Nov 2021 09:39:15 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5ff60d224d2179006ebd8a15&quot; class=&quot;user-hover&quot; rel=&quot;5ff60d224d2179006ebd8a15&quot; data-account-id=&quot;5ff60d224d2179006ebd8a15&quot; accountid=&quot;5ff60d224d2179006ebd8a15&quot; rel=&quot;noreferrer&quot;&gt;twliu&lt;/a&gt; &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3Ac2a5f0f6-9d45-4202-ad88-c57f05316346&quot; class=&quot;user-hover&quot; rel=&quot;70121:c2a5f0f6-9d45-4202-ad88-c57f05316346&quot; data-account-id=&quot;70121:c2a5f0f6-9d45-4202-ad88-c57f05316346&quot; accountid=&quot;70121:c2a5f0f6-9d45-4202-ad88-c57f05316346&quot; rel=&quot;noreferrer&quot;&gt;Gang Zhou&lt;/a&gt; &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Adea2f026-f9d7-42e0-af50-31b385c95e3e&quot; class=&quot;user-hover&quot; rel=&quot;557058:dea2f026-f9d7-42e0-af50-31b385c95e3e&quot; data-account-id=&quot;557058:dea2f026-f9d7-42e0-af50-31b385c95e3e&quot; accountid=&quot;557058:dea2f026-f9d7-42e0-af50-31b385c95e3e&quot; rel=&quot;noreferrer&quot;&gt;Cheryl Malmborg&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Marc, this is a go-live blocker for Shanghai Library. So it needs to be solved as soon as possible (by December). &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I understand this is urgent and important.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=62a96ae7192edb006f9f1bf9&quot; class=&quot;user-hover&quot; rel=&quot;62a96ae7192edb006f9f1bf9&quot; data-account-id=&quot;62a96ae7192edb006f9f1bf9&quot; accountid=&quot;62a96ae7192edb006f9f1bf9&quot; rel=&quot;noreferrer&quot;&gt;Khalilah Gambrell&lt;/a&gt; &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5d794c218ce6b60c3810eb8a&quot; class=&quot;user-hover&quot; rel=&quot;5d794c218ce6b60c3810eb8a&quot; data-account-id=&quot;5d794c218ce6b60c3810eb8a&quot; accountid=&quot;5d794c218ce6b60c3810eb8a&quot; rel=&quot;noreferrer&quot;&gt;Stephanie Buck&lt;/a&gt; &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5af5ecdb772036612ff61cf1&quot; class=&quot;user-hover&quot; rel=&quot;5af5ecdb772036612ff61cf1&quot; data-account-id=&quot;5af5ecdb772036612ff61cf1&quot; accountid=&quot;5af5ecdb772036612ff61cf1&quot; rel=&quot;noreferrer&quot;&gt;Hkaplanian&lt;/a&gt; &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Aa957226f-df85-4fc8-97f4-8b27a26029ed&quot; class=&quot;user-hover&quot; rel=&quot;557058:a957226f-df85-4fc8-97f4-8b27a26029ed&quot; data-account-id=&quot;557058:a957226f-df85-4fc8-97f4-8b27a26029ed&quot; accountid=&quot;557058:a957226f-df85-4fc8-97f4-8b27a26029ed&quot; rel=&quot;noreferrer&quot;&gt;Holly Mistlebauer&lt;/a&gt; Who needs to be involved in prioritising this, is it the POs / Capacity Planning / the PC?&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;I think the first thing would be a clarification of how folio is keeping track of how many loans a patron has checked out. Are the patron&apos;s loans re-queried with each item checked out or does the module increment a session counter?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I&apos;ve done a little research into this area. It seems the item limit behaviour was implemented in 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;CIRC-558&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/CIRC-558&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;BE  - Implement automatic item blocks&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;
            CIRC-558
        &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;
 as part of the automated patron blocks work by Vega. I suggest we involve the Vega team (&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5d794c218ce6b60c3810eb8a&quot; class=&quot;user-hover&quot; rel=&quot;5d794c218ce6b60c3810eb8a&quot; data-account-id=&quot;5d794c218ce6b60c3810eb8a&quot; accountid=&quot;5d794c218ce6b60c3810eb8a&quot; rel=&quot;noreferrer&quot;&gt;Stephanie Buck&lt;/a&gt;, &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=712020%3A12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; class=&quot;user-hover&quot; rel=&quot;712020:12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; data-account-id=&quot;712020:12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; accountid=&quot;712020:12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; rel=&quot;noreferrer&quot;&gt;Alexander Kurash&lt;/a&gt;) in this conversation.&lt;/p&gt;

&lt;p&gt;I believe the Vega team also did the work on sessions.&lt;/p&gt;

&lt;p&gt;A quick check of the code suggests to me:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;the item limit checks are performed each check out, based upon open loans, the item status, material type and loan type.&lt;/li&gt;
	&lt;li&gt;check out / check in sessions are primarily related to notices and don&apos;t affect other behaviour.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=712020%3A12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; class=&quot;user-hover&quot; rel=&quot;712020:12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; data-account-id=&quot;712020:12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; accountid=&quot;712020:12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; rel=&quot;noreferrer&quot;&gt;Alexander Kurash&lt;/a&gt; How wrong is my understanding?&lt;/p&gt;

&lt;p&gt;cc: &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Aa957226f-df85-4fc8-97f4-8b27a26029ed&quot; class=&quot;user-hover&quot; rel=&quot;557058:a957226f-df85-4fc8-97f4-8b27a26029ed&quot; data-account-id=&quot;557058:a957226f-df85-4fc8-97f4-8b27a26029ed&quot; accountid=&quot;557058:a957226f-df85-4fc8-97f4-8b27a26029ed&quot; rel=&quot;noreferrer&quot;&gt;Holly Mistlebauer&lt;/a&gt;&lt;/p&gt;</comment>
                                                            <comment id="14256" author="5ee89462f7aa140abd82d11d" created="Mon, 22 Nov 2021 16:42:54 +0000"  >&lt;p&gt;The item limit check (refuseWhenItemLimitIsReached) is special because its outcome can change when other loans are created in parallel.&lt;/p&gt;

&lt;p&gt;The use case of a machine sending multiple check-out requests for a single patron in parallel is reasonable and should be supported for performance reasons.&lt;/p&gt;

&lt;p&gt;A race condition where parallel check-outs exceed the item limit can be completely avoided if PostgreSQL features are used:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Move the item limit check (refuseWhenItemLimitIsReached Java code) from mod-circulation into a mod-circulation-storage SQL code.&lt;/li&gt;
	&lt;li&gt;The limit check and creating the loan are merged into a single database transaction.&lt;/li&gt;
	&lt;li&gt;If the limit is reached an error is returned, otherwise the loan is created.&lt;/li&gt;
	&lt;li&gt;The database transaction starts with &quot;SELECT id FROM loans WHERE ... &lt;a href=&quot;https://www.postgresql.org/docs/current/sql-select.html#SQL-FOR-UPDATE-SHARE&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;FOR UPDATE&lt;/a&gt;&quot; of the patron&apos;s open loans. This makes all other transactions of that patron to wait until the transaction has finished and therefore avoids ROLLBACK that might happen when they were running concurrently. The &quot;SELECT ... FOR UPDATE&quot; should select only the loans needed for the item limit count (&lt;a href=&quot;https://www.postgresql.org/docs/current/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;ROW_COUNT&lt;/a&gt;).&lt;/li&gt;
	&lt;li&gt;mod-circulation-storage&apos;s transaction SQL code requires some fields to exist in the loan record to do the item limit check, they need to be copied from the mod-inventory-storage item record into the mod-circulation-storage loan record when creating or renewing the loan: isClaimedReturned, materialTypeId, loanTypeId (similar to the existing &lt;tt&gt;itemEffectiveLocationIdAtCheckOut&lt;/tt&gt; or &#160;&lt;tt&gt;overdueFinePolicyId&lt;/tt&gt;)&lt;/li&gt;
	&lt;li&gt;For best performance of the item limit check some database indexes should be created so that the SELECT query can be calculated using only the indexes without fetching the complete loan records.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                                                            <comment id="14259" author="5d794c218ce6b60c3810eb8a" created="Wed, 19 Jan 2022 21:18:29 +0000"  >&lt;p&gt;Hi all. This has been moved from a bug to a feature. &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ab92c545f-a9eb-488e-9d26-fe6b921e4fbb&quot; class=&quot;user-hover&quot; rel=&quot;557058:b92c545f-a9eb-488e-9d26-fe6b921e4fbb&quot; data-account-id=&quot;557058:b92c545f-a9eb-488e-9d26-fe6b921e4fbb&quot; accountid=&quot;557058:b92c545f-a9eb-488e-9d26-fe6b921e4fbb&quot; rel=&quot;noreferrer&quot;&gt;Raman Auramau&lt;/a&gt;&#160;and &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=712020%3A12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; class=&quot;user-hover&quot; rel=&quot;712020:12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; data-account-id=&quot;712020:12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; accountid=&quot;712020:12031ab4-cff4-4571-b23b-43dcfc15a6ac&quot; rel=&quot;noreferrer&quot;&gt;Alexander Kurash&lt;/a&gt;&#160;have been working on architecture for a solution. There will likely be more stories associated as we move forward.&#160;&lt;/p&gt;</comment>
                                                            <comment id="14261" author="62e94faeb5b801a9afeeccc1" created="Sun, 18 Sep 2022 19:46:37 +0000"  >&lt;p&gt;So, in a nutshell, for any item being checked out via SIP2, confirm the patron has not exceeded total number of items charged to their account according to circulation rules. It sounds like this check is not happening on each request?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=63fc4679f00d095406f1e855&quot; class=&quot;user-hover&quot; rel=&quot;63fc4679f00d095406f1e855&quot; data-account-id=&quot;63fc4679f00d095406f1e855&quot; accountid=&quot;63fc4679f00d095406f1e855&quot; rel=&quot;noreferrer&quot;&gt;Gurleen Kaur1&lt;/a&gt; &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=712020%3Ac05070d8-1808-4867-a794-716fd3b6555f&quot; class=&quot;user-hover&quot; rel=&quot;712020:c05070d8-1808-4867-a794-716fd3b6555f&quot; data-account-id=&quot;712020:c05070d8-1808-4867-a794-716fd3b6555f&quot; accountid=&quot;712020:c05070d8-1808-4867-a794-716fd3b6555f&quot; rel=&quot;noreferrer&quot;&gt;Giorgi Ninua&lt;/a&gt; I think this can go to a Volaris developer to confirm existing behavior and, if the behavior is not correct, make corresponding changes to enforce the check for each checkout request.&#160;&lt;/p&gt;</comment>
                                                            <comment id="14263" author="63fc4679f00d095406f1e855" created="Mon, 19 Sep 2022 07:39:37 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=62e94faeb5b801a9afeeccc1&quot; class=&quot;user-hover&quot; rel=&quot;62e94faeb5b801a9afeeccc1&quot; data-account-id=&quot;62e94faeb5b801a9afeeccc1&quot; accountid=&quot;62e94faeb5b801a9afeeccc1&quot; rel=&quot;noreferrer&quot;&gt;Tim Auger&lt;/a&gt; ,&#160;&lt;br/&gt;
In edge-sip2 code there is no specific check added for the checkout. As far as I know when perfromCheckout will be invoked then within the mod-circulation module this check should be added or implemented. As Sip2 generally does not contain the business logic and based on the commands its corresponding backend module is invoked within which the validations, business logic, etc is performed and the response is sent back to SIP2 for the end users console.&lt;br/&gt;
CC: &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=712020%3Ac05070d8-1808-4867-a794-716fd3b6555f&quot; class=&quot;user-hover&quot; rel=&quot;712020:c05070d8-1808-4867-a794-716fd3b6555f&quot; data-account-id=&quot;712020:c05070d8-1808-4867-a794-716fd3b6555f&quot; accountid=&quot;712020:c05070d8-1808-4867-a794-716fd3b6555f&quot; rel=&quot;noreferrer&quot;&gt;Giorgi Ninua&lt;/a&gt;&#160;&lt;/p&gt;</comment>
                                                            <comment id="14266" author="63e2a2771b13d42998e4e706" created="Wed, 21 Sep 2022 11:03:44 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=62e94faeb5b801a9afeeccc1&quot; class=&quot;user-hover&quot; rel=&quot;62e94faeb5b801a9afeeccc1&quot; data-account-id=&quot;62e94faeb5b801a9afeeccc1&quot; accountid=&quot;62e94faeb5b801a9afeeccc1&quot; rel=&quot;noreferrer&quot;&gt;Tim Auger&lt;/a&gt; &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=63fc4679f00d095406f1e855&quot; class=&quot;user-hover&quot; rel=&quot;63fc4679f00d095406f1e855&quot; data-account-id=&quot;63fc4679f00d095406f1e855&quot; accountid=&quot;63fc4679f00d095406f1e855&quot; rel=&quot;noreferrer&quot;&gt;Gurleen Kaur1&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;It sounds like this check is not happening on each request?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The check is performed on every check out request.&lt;/p&gt;

&lt;p&gt;The concern that folks have is that when a SIP2 based self-checkout machine (or other client) makes that check out requests in parallel, then the checks could overlap with other check outs.&lt;/p&gt;

&lt;p&gt;As checks tend to be performed near the beginning of the process, the checks could falsely succeed because a check out that would lead to the item limit being reached had not completed before the check happens.&lt;/p&gt;

&lt;p&gt;Does that make sense?&lt;/p&gt;</comment>
                                                            <comment id="14268" author="5ee89462f7aa140abd82d11d" created="Wed, 21 Sep 2022 15:16:16 +0000"  >&lt;p&gt;This is caused by a race condition: After refuseWhenItemLimitIsReached is called (line 125) many other operations take place before createLoan is called (line 140): &lt;a href=&quot;https://github.com/folio-org/mod-circulation/blob/v22.1.3/src/main/java/org/folio/circulation/resources/CheckOutByBarcodeResource.java#L125-L140&quot; class=&quot;external-link&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/folio-org/mod-circulation/blob/v22.1.3/src/main/java/org/folio/circulation/resources/CheckOutByBarcodeResource.java#L125-L140&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Assuming 9 items have been loaned and the item limit is 10.&lt;/p&gt;

&lt;p&gt;When running in sequence:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
item10 refuseWhenItemLimitIsReached &amp;lt;- &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; finds 9 loaned items and continues
item10 other operations
item10 createLoan
item11 refuseWhenItemLimitIsReached &amp;lt;- &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; finds 10 loaned items and exits with item limit error
item11 other operations
item11 createLoan
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;When running in parallel:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
item10 refuseWhenItemLimitIsReached &amp;lt;- &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; finds 9 loaned items and continues
item11 refuseWhenItemLimitIsReached &amp;lt;- &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; finds 9 loaned items and continues
item10 other operations
item11 other operations
item10 createLoan
item11 createLoan &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;item11 is incorrectly loaned because the item11 limit check runs between the item10 limit check and the item10 createLoan (race condition).&lt;/p&gt;</comment>
                                                            <comment id="14270" author="62e94faeb5b801a9afeeccc1" created="Wed, 21 Sep 2022 16:55:11 +0000"  >&lt;p&gt;Thanks, &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=63e2a2771b13d42998e4e706&quot; class=&quot;user-hover&quot; rel=&quot;63e2a2771b13d42998e4e706&quot; data-account-id=&quot;63e2a2771b13d42998e4e706&quot; accountid=&quot;63e2a2771b13d42998e4e706&quot; rel=&quot;noreferrer&quot;&gt;Marc Johnson&lt;/a&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; for the additional info. This makes sense. And, given the speed of batch-like checkout via RFID enabled self-check systems and slow network speeds, could see this happen more frequently than anyone would like. Do either of you believe a refactor could resolve this or is it more than that?&lt;/p&gt;</comment>
                                                            <comment id="14272" author="63e2a2771b13d42998e4e706" created="Wed, 21 Sep 2022 17:34:30 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=62e94faeb5b801a9afeeccc1&quot; class=&quot;user-hover&quot; rel=&quot;62e94faeb5b801a9afeeccc1&quot; data-account-id=&quot;62e94faeb5b801a9afeeccc1&quot; accountid=&quot;62e94faeb5b801a9afeeccc1&quot; rel=&quot;noreferrer&quot;&gt;Tim Auger&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Do either of you believe a refactor could resolve this or is it more than that?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I think that is better asked of the relevant development team. I believe the Vega team put together a proposal for resolving this.&lt;/p&gt;

&lt;p&gt;Personally, I don&apos;t think I would consider the likely solution to this to be a refactoring. I would expect it to involve significant changes. That this was originally a single issue for mod-circulation and is now a feature, suggests other folks also think there is considerably work involved.&lt;/p&gt;

&lt;p&gt;Roughly speaking, the system needs to be changed so that check outs for the same patron cannot occur concurrently. This can either happen at the whole process level or (as I think was proposed) that there would be some kind of locking mechanism around the item limit check so that couldn&apos;t be performed if any other check out was ongoing.&lt;/p&gt;</comment>
                                                            <comment id="14274" author="62e94faeb5b801a9afeeccc1" created="Wed, 21 Sep 2022 20:40:07 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=63e2a2771b13d42998e4e706&quot; class=&quot;user-hover&quot; rel=&quot;63e2a2771b13d42998e4e706&quot; data-account-id=&quot;63e2a2771b13d42998e4e706&quot; accountid=&quot;63e2a2771b13d42998e4e706&quot; rel=&quot;noreferrer&quot;&gt;Marc Johnson&lt;/a&gt; Cool. Based on the description and discussions I had with Vince, I thought it might be more than just restructuring. Thanks for the additional information.&#160;&lt;/p&gt;</comment>
                                                            <comment id="14276" author="62a96ae7192edb006f9f1bf9" created="Wed, 5 Oct 2022 17:13:09 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3Ac2a5f0f6-9d45-4202-ad88-c57f05316346&quot; class=&quot;user-hover&quot; rel=&quot;70121:c2a5f0f6-9d45-4202-ad88-c57f05316346&quot; data-account-id=&quot;70121:c2a5f0f6-9d45-4202-ad88-c57f05316346&quot; accountid=&quot;70121:c2a5f0f6-9d45-4202-ad88-c57f05316346&quot; rel=&quot;noreferrer&quot;&gt;Gang Zhou&lt;/a&gt;&#160; and &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=5ff60d224d2179006ebd8a15&quot; class=&quot;user-hover&quot; rel=&quot;5ff60d224d2179006ebd8a15&quot; data-account-id=&quot;5ff60d224d2179006ebd8a15&quot; accountid=&quot;5ff60d224d2179006ebd8a15&quot; rel=&quot;noreferrer&quot;&gt;twliu&lt;/a&gt; - how has Shanghai addressed this issue?&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;cc: &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=62e94faeb5b801a9afeeccc1&quot; class=&quot;user-hover&quot; rel=&quot;62e94faeb5b801a9afeeccc1&quot; data-account-id=&quot;62e94faeb5b801a9afeeccc1&quot; accountid=&quot;62e94faeb5b801a9afeeccc1&quot; rel=&quot;noreferrer&quot;&gt;Tim Auger&lt;/a&gt; and &lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Adea2f026-f9d7-42e0-af50-31b385c95e3e&quot; class=&quot;user-hover&quot; rel=&quot;557058:dea2f026-f9d7-42e0-af50-31b385c95e3e&quot; data-account-id=&quot;557058:dea2f026-f9d7-42e0-af50-31b385c95e3e&quot; accountid=&quot;557058:dea2f026-f9d7-42e0-af50-31b385c95e3e&quot; rel=&quot;noreferrer&quot;&gt;Cheryl Malmborg&lt;/a&gt;&#160;&lt;/p&gt;</comment>
                                                            <comment id="14278" author="62e94faeb5b801a9afeeccc1" created="Mon, 24 Apr 2023 01:14:27 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3A1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; class=&quot;user-hover&quot; rel=&quot;70121:1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; data-account-id=&quot;70121:1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; accountid=&quot;70121:1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; rel=&quot;noreferrer&quot;&gt;Irina Pokhylets&lt;/a&gt; we should move this forward.&lt;/p&gt;</comment>
                                                            <comment id="14280" author="62e94faeb5b801a9afeeccc1" created="Tue, 2 May 2023 18:44:38 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3A1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; class=&quot;user-hover&quot; rel=&quot;70121:1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; data-account-id=&quot;70121:1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; accountid=&quot;70121:1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; rel=&quot;noreferrer&quot;&gt;Irina Pokhylets&lt;/a&gt; we can move forward with this. Just talked with Steph. Alex K. is who we can help with arch. Cheryl is the community PO&lt;/p&gt;</comment>
                                                            <comment id="14282" author="70121:1dedb047-b475-4ea4-9be9-79b3aa27956f" created="Wed, 3 May 2023 09:32:18 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=62e94faeb5b801a9afeeccc1&quot; class=&quot;user-hover&quot; rel=&quot;62e94faeb5b801a9afeeccc1&quot; data-account-id=&quot;62e94faeb5b801a9afeeccc1&quot; accountid=&quot;62e94faeb5b801a9afeeccc1&quot; rel=&quot;noreferrer&quot;&gt;Tim Auger&lt;/a&gt;&#160;&lt;/p&gt;

&lt;p&gt;Based on the result of investigation 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;CIRC-1740&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/CIRC-1740&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;SPIKE: Investigate possibility of resolving the issue with concurrent check-outs via self-check&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium&quot; /&gt;
            CIRC-1740
        &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 no clean way to solve the issue on the SIP-2 level and the issue needs to be solved in mod-circulation. The 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;CIRC-1786&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/CIRC-1786&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;Spike: Analyze of design document for implementation Check-out lock feature&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium&quot; /&gt;
            CIRC-1786
        &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;
 spike has been created for analyzing the proposed technical design.&lt;/p&gt;</comment>
                                                            <comment id="14284" author="62e94faeb5b801a9afeeccc1" created="Wed, 3 May 2023 17:50:54 +0000"  >&lt;p&gt;&lt;a href=&quot;https://folio-org.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3A1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; class=&quot;user-hover&quot; rel=&quot;70121:1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; data-account-id=&quot;70121:1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; accountid=&quot;70121:1dedb047-b475-4ea4-9be9-79b3aa27956f&quot; rel=&quot;noreferrer&quot;&gt;Irina Pokhylets&lt;/a&gt; thanks! Much appreciated. I changed the team for 
    &lt;span class=&quot;jira-issue-macro resolved&quot; data-jira-key=&quot;CIRC-1786&quot; &gt;
                &lt;a href=&quot;https://folio-org.atlassian.net/browse/CIRC-1786&quot; class=&quot;jira-issue-macro-key issue-link&quot;  title=&quot;Spike: Analyze of design document for implementation Check-out lock feature&quot; &gt;
            &lt;img class=&quot;icon&quot; src=&quot;https://folio-org.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10318?size=medium&quot; /&gt;
            CIRC-1786
        &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;
 to Volaris. Vega is happy to be consulted (and should be consulted) on any proposed changes. Thanks!&lt;/p&gt;</comment>
                                                            <comment id="14286" author="70121:1dedb047-b475-4ea4-9be9-79b3aa27956f" created="Thu, 28 Sep 2023 10:57:11 +0000"  >&lt;p&gt;Closing the feature as all related tickets are closed.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Continues</name>
                                                                <inwardlinks description="is continued by">
                                        <issuelink>
            <issuekey id="49645">CIRC-1821</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="30391">CIRCSTORE-423</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="15757">FAT-6575</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="49647">CIRC-1822</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="49307">CIRC-1380</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="49335">CIRC-1405</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="49580">CIRC-1756</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="49605">CIRC-1786</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="49616">CIRC-1805</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="30423">CIRCSTORE-416</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="27195">PERF-627</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="49301">CIRC-1378</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="49642">CIRC-1740</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10007">
                    <name>Requires</name>
                                            <outwardlinks description="requires">
                                        <issuelink>
            <issuekey id="49298">CIRC-1377</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                        <customfield id="customfield_10107" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Affected Institution</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10409"><![CDATA[SHL]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Back End Estimate</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10123"><![CDATA[XL < 15 days]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <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="10188"><![CDATA[Volaris]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10014" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue key="$xmlutils.escape($text)">Circ Rules and Loan Policies</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10050" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Front End Estimate</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10094"><![CDATA[Out of scope]]></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_10019" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|hzx268:iuns</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10069" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Rank: Cornell (Full Sum 2021)</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10216"><![CDATA[R4]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10070" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Rank: Duke (Full Sum 2021)</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10220"><![CDATA[R3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10046" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Release</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10076"><![CDATA[Poppy (R2 2023)]]></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>Mon, 15 Nov 2021 21:44:07 +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>