Commit 955ed9e
authored
Add suppressed exception details in NativeFSLockFactory lock acquisition failure (#16278)
* Add suppressed exception details in NativeFSLockFactory lock acquisition failure
When lock acquisition fails in NativeFSLockFactory.obtainFSLock, exceptions
thrown while closing the FileChannel are now attached as suppressed exceptions
to the original failure instead of being silently swallowed via
IOUtils.closeWhileHandlingException.
Changes:
- Replace finally block with catch(Throwable) to properly propagate suppressed
exceptions using IOUtils.closeWhileSuppressingExceptions and addSuppressed
- Add test testSuppressedExceptionOnLockFailure verifying close failures
appear as suppressed exceptions on the original lock failure
- Add CHANGES.txt entry under Lucene 11.0.0 Bug Fixes
Resolves the TODO comment at NativeFSLockFactory.java line 121.
* Update CHANGES.txt with PR number #16278
* Refactor NativeFSLockFactory lock acquisition to separate concerns1 parent 72182e3 commit 955ed9e
2 files changed
Lines changed: 31 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
198 | 200 | | |
199 | 201 | | |
200 | 202 | | |
| |||
Lines changed: 29 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
| 109 | + | |
111 | 110 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 111 | + | |
| 112 | + | |
119 | 113 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 114 | + | |
| 115 | + | |
123 | 116 | | |
124 | 117 | | |
125 | 118 | | |
126 | 119 | | |
127 | 120 | | |
128 | 121 | | |
129 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
130 | 147 | | |
131 | 148 | | |
132 | 149 | | |
| |||
0 commit comments