You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "rmuir (via GitHub)" <gi...@apache.org> on 2024/04/06 00:03:12 UTC
[PR] IndexWriter: Treat java.lang.Error as tragedy [lucene]
rmuir opened a new pull request, #13277:
URL: https://github.com/apache/lucene/pull/13277
Background:
Historically IndexWriter treated OutOfMemoryError special, for defensive reasons. It was expanded to VirtualMachineError, to try to play it safe in similar disastrous circumstances.
We should treat any Error as a tragedy, as it isn't an Exception, and it isn't something a "reasonable" application should catch. IndexWriter should be reasonable. See #7049 for some of the reasoning.
We can't pretend this will detect any possible scenario that might cause harm, e.g. a jvm bug might simply miscompile some code and cause silent corruption. But we should try harder by playing by the rules.
Closes #13275
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] IndexWriter: Treat java.lang.Error as tragedy [lucene]
Posted by "mikemccand (via GitHub)" <gi...@apache.org>.
mikemccand commented on PR #13277:
URL: https://github.com/apache/lucene/pull/13277#issuecomment-2049542084
> AssertionError is ok too I think, if a user wants to run with -ea, let's make it worth their while.
Cool!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] IndexWriter: Treat java.lang.Error as tragedy [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #13277:
URL: https://github.com/apache/lucene/pull/13277#issuecomment-2049057023
> * all subclasses of LinkageError read like "code is broken" to me.
Yes, this is why the code around MMapDir and MethodHandles in general is correct and needs no change. errorprone also complains if you rethrow linking errors from MethodHandles as RuntimeException.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] IndexWriter: Treat java.lang.Error as tragedy [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #13277:
URL: https://github.com/apache/lucene/pull/13277#issuecomment-2042666045
All fine, maybe I was not clear! I just wanted to mention the "catch Throwable" issue and that we should additionally deal with it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] IndexWriter: Treat java.lang.Error as tragedy [lucene]
Posted by "uschindler (via GitHub)" <gi...@apache.org>.
uschindler commented on PR #13277:
URL: https://github.com/apache/lucene/pull/13277#issuecomment-2041021031
We should also check that we always rethrow `Error` and `RuntimeException` in those catch-all `catch (Throwable)` blocks. Otherwise they are silently converted to
I would like to grep on `catch (Throwable` through all Lucene code and check that all is sane with rethrowing errors and runtimes unmodified. This is important especially with MethodHandles.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] IndexWriter: Treat java.lang.Error as tragedy [lucene]
Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #13277:
URL: https://github.com/apache/lucene/pull/13277#issuecomment-2043294016
Yes, there is real work to do there. I dug into it, I think we will need multiple issues for that one...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] IndexWriter: Treat java.lang.Error as tragedy [lucene]
Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #13277:
URL: https://github.com/apache/lucene/pull/13277#issuecomment-2048667001
I've been mulling over this PR for a while, not the type of one you want to rush in. But the more I think about it, the more I like it.
* javadocs for Error describe them as `abnormal conditions that should never occur`
* these are Errors IndexWriter is hitting from lucene apis, not application code.
* user can plug into low-level lucene apis such as `Directory`, `Codec`, etc, but the same rules apply
* the fact none of our test suite needed changes is telling.
* All subclasses of LinkageError
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] IndexWriter: Treat java.lang.Error as tragedy [lucene]
Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on PR #13277:
URL: https://github.com/apache/lucene/pull/13277#issuecomment-2041270352
> We should also check that we always rethrow `Error` and `RuntimeException` in those catch-all `catch (Throwable)` blocks. Otherwise they are silently converted to something different and code here won't see this as tragedy.
>
> I would like to grep on `catch (Throwable` through all Lucene code and check that all is sane with rethrowing errors and runtimes unmodified. This is important especially with MethodHandles.
This is unchanged from today though, if there are problems, they already affect us with `VirtualMachineError`. This just broadens the behavior check to `Error`.
To be clear, I agree with the cleanup, but it should not be mixed inside this issue and needs to be broken up. There are a couple obvious cleanups in not-so-critical code here, but then there's important stuff, too (e.g. MMap is broke here, and definitely IndexWriter classes).
Should not be mixed in this, it is just an unrelated cleanup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] IndexWriter: Treat java.lang.Error as tragedy [lucene]
Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir merged PR #13277:
URL: https://github.com/apache/lucene/pull/13277
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org