[
https://issues.apache.org/jira/browse/IGNITE-22721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Roman Puchkovskiy updated IGNITE-22721:
---------------------------------------
Description:
ExceptionUtils#copyExceptionWithCause() assumes that each exception passed to
it will have at least one of constructors from the predefined list of
signatures. If an exception does not have such a constructor, the method
returns null which makes it not safe. We already have places in code (look them
up by the key of this issue) which do 'try to copy an exception; if not, create
a fallback exception' which looks ugly.
It was supposed to have an (automatically enforced) rule that makes sure that
each internal exception obeys this requirement, but:
# The rule (implemented as a test for archtest) does not seem to be actually
enforced (at least there is MismatchingTransactionOutcomeException which
violates the rule)
# It seems convenient to have custom exception fields and correspondingly
non-standard constructor signatures
We should either avoid copying, or enforce the rules that are required to make
it work.
was:
ExceptionUtils#copyExceptionWithCause() assumes that each exception passed to
it will have at least one of constructors from the predefined list of
signatures. If an exception does not have such a constructor, the method
returns null which makes it not safe. We already have places in code (look them
up by the key of this issue) which do 'try to copy an exception; if not, create
a fallback exception' which looks ugly.
It was supposed to have an (automatically enforced) rule that makes sure that
each internal exception obeys this requirement
> Exception copying mechanism might fail
> --------------------------------------
>
> Key: IGNITE-22721
> URL: https://issues.apache.org/jira/browse/IGNITE-22721
> Project: Ignite
> Issue Type: Improvement
> Reporter: Roman Puchkovskiy
> Priority: Major
> Labels: ignite-3
>
> ExceptionUtils#copyExceptionWithCause() assumes that each exception passed to
> it will have at least one of constructors from the predefined list of
> signatures. If an exception does not have such a constructor, the method
> returns null which makes it not safe. We already have places in code (look
> them up by the key of this issue) which do 'try to copy an exception; if not,
> create a fallback exception' which looks ugly.
> It was supposed to have an (automatically enforced) rule that makes sure that
> each internal exception obeys this requirement, but:
> # The rule (implemented as a test for archtest) does not seem to be actually
> enforced (at least there is MismatchingTransactionOutcomeException which
> violates the rule)
> # It seems convenient to have custom exception fields and correspondingly
> non-standard constructor signatures
> We should either avoid copying, or enforce the rules that are required to
> make it work.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)