Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-1898

OAI not always closing contexts

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0, 3.1, 3.2, 4.0
    • Fix Version/s: 3.3, 4.1
    • Component/s: OAI-PMH
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      3
    • Documentation Status:
      Not Required

      Description

      The main OAI data provider class creates a new context and closes this in case no exceptions occur. But when an exception does occur the context remains open.
      This could cause a thread pool exception and bring down the entire DSpace.

        Attachments

          Issue Links

            Activity

            Hide
            helix84 Ivan Masár added a comment -

            Hi Kevin, is this as easy as adding "if (context != null) context.abort();" here?

            https://github.com/DSpace/DSpace/blob/dspace-4_x/dspace-oai/src/main/java/org/dspace/xoai/DSpaceOAIDataProvider.java#L147

            How do we test it?

            Show
            helix84 Ivan Masár added a comment - Hi Kevin, is this as easy as adding "if (context != null) context.abort();" here? https://github.com/DSpace/DSpace/blob/dspace-4_x/dspace-oai/src/main/java/org/dspace/xoai/DSpaceOAIDataProvider.java#L147 How do we test it?
            Hide
            kevin van de velde Kevin Van de Velde (@mire) added a comment -

            Pull request: https://github.com/DSpace/DSpace/pull/462

            This adds a finally call so that in case of any exception the context is closed. Best way to test it would be to add an ensured exception within the try finally loop before the context is closed.

            Show
            kevin van de velde Kevin Van de Velde (@mire) added a comment - Pull request: https://github.com/DSpace/DSpace/pull/462 This adds a finally call so that in case of any exception the context is closed. Best way to test it would be to add an ensured exception within the try finally loop before the context is closed.
            Hide
            helix84 Ivan Masár added a comment -

            Change cherry-picked to dspace-4_x (4.1) and dspace-3_x (3.3), but not to master where the change would conflict with a larger overhaul (which already includes this change according to João).

            https://github.com/DSpace/DSpace/commit/61255bfd24c74339b7ff58bc8bdb143333ce5c90
            https://github.com/DSpace/DSpace/commit/4b4e65cf0f4ad3b11f8391137cae66a54af7cc13

            Show
            helix84 Ivan Masár added a comment - Change cherry-picked to dspace-4_x (4.1) and dspace-3_x (3.3), but not to master where the change would conflict with a larger overhaul (which already includes this change according to João). https://github.com/DSpace/DSpace/commit/61255bfd24c74339b7ff58bc8bdb143333ce5c90 https://github.com/DSpace/DSpace/commit/4b4e65cf0f4ad3b11f8391137cae66a54af7cc13

              People

              • Assignee:
                kevin van de velde Kevin Van de Velde (@mire)
                Reporter:
                kevin van de velde Kevin Van de Velde (@mire)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: