Skip to content

GEODE-9990: turn DiskAccessException into CacheClosedException#7334

Merged
jmelchio merged 4 commits intoapache:developfrom
jmelchio:geode-9990
Feb 11, 2022
Merged

GEODE-9990: turn DiskAccessException into CacheClosedException#7334
jmelchio merged 4 commits intoapache:developfrom
jmelchio:geode-9990

Conversation

@jmelchio
Copy link
Contributor

@jmelchio jmelchio commented Feb 2, 2022

  • when DiskInitFile is in closed state and DiskStoreImpl is closed or
    closing
  • catch DiskAccessException in PRHARedundancyProvider and turn into
    CacheClosedException if cache closing is in progress
  • change CreateBucketMessage to handle DiskAccessException as cause of
    ReplyException

- when DiskInitFile is in closed state and DiskStoreImpl is closed or
  closing
- catch DiskAccessException in PRHARedundancyProvider and turn into
  CacheClosedException if cache closing is in progress
- change CreateBucketMessage to handle DiskAccessException as cause of
  ReplyException
Copy link
Contributor

@DonalEvans DonalEvans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is lacking any tests to validate the fix. Would it be possible to add a DUnit test to show that with these changes, a remote DiskAccessException due to the cache closing during bucket creation does not result in the initiating member seeing that DiskAccessException? If that proves too complex to set up reliably in a DUnit test, at the very least unit test coverage should be added to validate the new behaviour.

parent.getCache().getCancelCriterion().checkCancelInProgress();

if (parent.isClosed() || parent.isClosing()) {
throw new CacheClosedException("The disk store is closed or closing");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why CacheClosedException is thrown here. If the cache is closed, I assume checkCancelInProgress will throw CacheClosedException.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache is not closed yet. But is going to be closed by the exception with disk-store. Also the cache close happens in the async thread, that will take some time to get initiated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Looking into cancelInProgress() in DiskStoreImpl.Stopper, it only checksisClosed(). But it doesn't check isClosing(). It is good to have if (parent.isClosed() || parent.isClosing()) here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should use OplogCancelledException instead of CacheClosedException here?

@jinmeiliao
Copy link
Member

some unit test to test the updated code path would be nice

- refactor to reduce code duplication
- remove surplus logging
- unit test additons for PRHARedundancyProvider
@jmelchio jmelchio requested a review from jchen21 February 11, 2022 14:35
parent.getCache().getCancelCriterion().checkCancelInProgress();

if (parent.isClosed() || parent.isClosing()) {
throw new CacheClosedException("The disk store is closed or closing");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Looking into cancelInProgress() in DiskStoreImpl.Stopper, it only checksisClosed(). But it doesn't check isClosing(). It is good to have if (parent.isClosed() || parent.isClosing()) here.

@jmelchio jmelchio merged commit a98197b into apache:develop Feb 11, 2022
Copy link
Contributor

@onichols-pivotal onichols-pivotal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per https://cwiki.apache.org/confluence/display/GEODE/Commit+Message+Format, first commit summary should be under 30 characters (not including bug# or pr#) (yours is 50 characters). If you amend your initial commit now and force-push, you can benefit from review feedback on your commit message, and you won't have to remember to fix it later when you merge.

jmelchio added a commit to jmelchio/geode that referenced this pull request Feb 16, 2022
…e#7334)

* GEODE-9990: turn DiskAccessException into CacheClosedException

- when DiskInitFile is in closed state and DiskStoreImpl is closed or
  closing
- catch DiskAccessException in PRHARedundancyProvider and turn into
  CacheClosedException if cache closing is in progress
- change CreateBucketMessage to handle DiskAccessException as cause of
  ReplyException

(cherry picked from commit a98197b)
jmelchio added a commit that referenced this pull request Feb 17, 2022
#7374)

* GEODE-9990: turn DiskAccessException into CacheClosedException

- when DiskInitFile is in closed state and DiskStoreImpl is closed or
  closing
- catch DiskAccessException in PRHARedundancyProvider and turn into
  CacheClosedException if cache closing is in progress
- change CreateBucketMessage to handle DiskAccessException as cause of
  ReplyException

(cherry picked from commit a98197b)
jmelchio added a commit to jmelchio/geode that referenced this pull request Feb 17, 2022
…e#7334)

* GEODE-9990: turn DiskAccessException into CacheClosedException

- when DiskInitFile is in closed state and DiskStoreImpl is closed or
  closing
- catch DiskAccessException in PRHARedundancyProvider and turn into
  CacheClosedException if cache closing is in progress
- change CreateBucketMessage to handle DiskAccessException as cause of
  ReplyException

(cherry picked from commit a98197b)
jmelchio added a commit that referenced this pull request Feb 23, 2022
#7379)

* GEODE-9990: turn DiskAccessException into CacheClosedException

- when DiskInitFile is in closed state and DiskStoreImpl is closed or
  closing
- catch DiskAccessException in PRHARedundancyProvider and turn into
  CacheClosedException if cache closing is in progress
- change CreateBucketMessage to handle DiskAccessException as cause of
  ReplyException

(cherry picked from commit a98197b)
mhansonp pushed a commit to mhansonp/geode that referenced this pull request Mar 11, 2022
…e#7334)

* GEODE-9990: turn DiskAccessException into CacheClosedException

- when DiskInitFile is in closed state and DiskStoreImpl is closed or
  closing
- catch DiskAccessException in PRHARedundancyProvider and turn into
  CacheClosedException if cache closing is in progress
- change CreateBucketMessage to handle DiskAccessException as cause of
  ReplyException
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants