[TEST] Retry file move for SnaphotsAndFileSettingsIT#91863
Merged
grcevski merged 4 commits intoelastic:mainfrom Dec 6, 2022
Merged
[TEST] Retry file move for SnaphotsAndFileSettingsIT#91863grcevski merged 4 commits intoelastic:mainfrom
grcevski merged 4 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Contributor
Author
|
@elasticsearchmachine run elasticsearch-ci/part-2-windows |
thecoop
reviewed
Dec 5, 2022
| Files.move(tempFilePath, fileSettingsService.operatorSettingsFile(), StandardCopyOption.ATOMIC_MOVE); | ||
| return; | ||
| } catch (IOException e) { | ||
| if (retryCount == 4) { // retry 5 times |
Member
There was a problem hiding this comment.
Is it worth logging something indicating it's hit the retry?
Contributor
Author
There was a problem hiding this comment.
Ah yeah, good idea. I'll add that. Thanks!
Contributor
Author
|
@elasticsearchmachine run elasticsearch-ci/part-1-windows |
1 similar comment
Contributor
Author
|
@elasticsearchmachine run elasticsearch-ci/part-1-windows |
Contributor
Author
|
@elasticsearchmachine run elasticsearch-ci/part-2 |
elasticsearchmachine
pushed a commit
that referenced
this pull request
Nov 11, 2024
Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (#91863), plus addressed a related issue around mock windows file-systems misbehaving (#92653). This PR extends the above fixes to all file-settings related ITs.
n1v0lg
added a commit
to n1v0lg/elasticsearch
that referenced
this pull request
Nov 13, 2024
…6392) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (elastic#91863), plus addressed a related issue around mock windows file-systems misbehaving (elastic#92653). This PR extends the above fixes to all file-settings related ITs. (cherry picked from commit 91559da)
n1v0lg
added a commit
to n1v0lg/elasticsearch
that referenced
this pull request
Nov 13, 2024
…6392) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (elastic#91863), plus addressed a related issue around mock windows file-systems misbehaving (elastic#92653). This PR extends the above fixes to all file-settings related ITs. (cherry picked from commit 91559da)
jozala
pushed a commit
that referenced
this pull request
Nov 13, 2024
Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (#91863), plus addressed a related issue around mock windows file-systems misbehaving (#92653). This PR extends the above fixes to all file-settings related ITs.
elasticsearchmachine
pushed a commit
that referenced
this pull request
Nov 13, 2024
…116709) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (#91863), plus addressed a related issue around mock windows file-systems misbehaving (#92653). This PR extends the above fixes to all file-settings related ITs. (cherry picked from commit 91559da)
elasticsearchmachine
pushed a commit
that referenced
this pull request
Nov 14, 2024
…116710) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (#91863), plus addressed a related issue around mock windows file-systems misbehaving (#92653). This PR extends the above fixes to all file-settings related ITs. (cherry picked from commit 91559da) Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
afoucret
pushed a commit
to afoucret/elasticsearch
that referenced
this pull request
Nov 14, 2024
…6392) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (elastic#91863), plus addressed a related issue around mock windows file-systems misbehaving (elastic#92653). This PR extends the above fixes to all file-settings related ITs.
alexey-ivanov-es
pushed a commit
to alexey-ivanov-es/elasticsearch
that referenced
this pull request
Nov 28, 2024
…6392) Several file-settings ITs fail (rarely) with exceptions like: ``` java.nio.file.AccessDeniedException: C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempFile-001.tmp -> C:\Users\jenkins\workspace\platform-support\14\server\build\testrun\internalClusterTest\temp\org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT_5733F2A737542BE-001\tempDir-002\config\operator\settings.json | at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) | -- | -- | | at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) | | | at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317) | | | at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at org.apache.lucene.tests.mockfile.FilterFileSystemProvider.move(FilterFileSystemProvider.java:144) | | | at java.nio.file.Files.move(Files.java:1430) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.writeJSONFile(SnaphotsAndFileSettingsIT.java:86) | | | at org.elasticsearch.reservedstate.service.SnaphotsAndFileSettingsIT.testRestoreWithPersistedFileSettings(SnaphotsAndFileSettingsIT.java:321) ``` This happens in Windows file systems, due to a race condition where the file settings service is reading the settings file concurrently with the test trying to modify it (a no-go in Windows). It turns out we have already addressed this with a retry for one test suite (elastic#91863), plus addressed a related issue around mock windows file-systems misbehaving (elastic#92653). This PR extends the above fixes to all file-settings related ITs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It seems that on Windows the file may not be unlocked on time and we occasionally fail to overwrite the settings.json for testing. This PR adds a retry loop to see if it resolves the issue.
Since this is very intermittent I won't backport this until we have confirmation it works. If it does work, I'll restructure all integration tests for file settings to use this method.
Closes #90692
For reference, this is the exception we hit: