Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try-catch block does not catch Throwable and as a consequence java.lang.NoClassDefFoundError can not be sent to the Client #18052

Closed
nosan opened this issue Jan 13, 2021 · 1 comment · Fixed by #18081
Assignees
Milestone

Comments

@nosan
Copy link

nosan commented Jan 13, 2021

A try-catch block should catch Throwable instead of Exception.
https://github.com/hazelcast/hazelcast/blob/master/hazelcast/src/main/java/com/hazelcast/map/impl/query/QueryOperation.java#L266
It can not catch java.lang.NoClassDefFoundError: and the exception can not be sent to the client.

Context:
Customer uploaded a wrong jar to hazelcast classpath (MyEnum enum is not present in the final JAR), then customer tries to apply a predicate:

EntryObject e = new PredicateBuilder().getEntryObject();
Predicate predicate = e.get("key").isNotNull();
map.values(predicate) //this call never finish

@sancar

Ok. Tried in my local. When in memory format of the map is NATIVE, client can not get the exception. When I am switching it to BINARY, the client gets the exception as expected.
Probably something on the NATIVE codepath is swallowing the exception.

@sancar sancar added this to the 3.12.12 milestone Jan 13, 2021
@mmedenjak mmedenjak added Module: IMap Module: Query Source: Internal PR or issue was opened by an employee labels Jan 15, 2021
sancar pushed a commit to sancar/hazelcast that referenced this issue Jan 21, 2021
HDQuery was not handling thrown Errors correctly.
The Error is not catched and therefore not delegated back to the
caller. A caller in that case hangs indefinetely.

fixes hazelcast#18052
sancar pushed a commit to sancar/hazelcast that referenced this issue Jan 21, 2021
HDQuery was not handling thrown Errors correctly.
The Error is not catched and therefore not delegated back to the
caller. A caller in that case hangs indefinitely.
fixes hazelcast#18052
sancar pushed a commit to sancar/hazelcast that referenced this issue Jan 21, 2021
HDQuery was not handling thrown Errors correctly.
The Error is not catched and therefore not delegated back to the
caller. A caller in that case hangs indefinitely.
fixes hazelcast#18052
sancar pushed a commit to sancar/hazelcast that referenced this issue Jan 22, 2021
HDQuery was not handling thrown Errors correctly.
The Error is not catched and therefore not delegated back to the
caller. A caller in that case hangs indefinetely.

fixes hazelcast#18052

(cherry picked from commit 882cd5c)
sancar pushed a commit that referenced this issue Jan 25, 2021
HDQuery was not handling thrown Errors correctly.
The Error is not catched and therefore not delegated back to the
caller. A caller in that case hangs indefinitely.
fixes #18052
@sancar
Copy link
Contributor

sancar commented Jan 25, 2021

@sancar sancar closed this as completed Jan 25, 2021
sancar pushed a commit that referenced this issue Jan 28, 2021
HDQuery was not handling thrown Errors correctly.
The Error is not catched and therefore not delegated back to the
caller. A caller in that case hangs indefinetely.

fixes #18052

(cherry picked from commit 882cd5c)
sancar pushed a commit that referenced this issue Jan 28, 2021
HDQuery was not handling thrown Errors correctly.
The Error is not catched and therefore not delegated back to the
caller. A caller in that case hangs indefinetely.

fixes #18052
sancar pushed a commit to sancar/hazelcast that referenced this issue Jan 28, 2021
HDQuery was not handling thrown Errors correctly.
The Error is not catched and therefore not delegated back to the
caller. A caller in that case hangs indefinetely.

fixes hazelcast#18052

(cherry picked from commit 882cd5c)
sancar pushed a commit that referenced this issue Jan 28, 2021
HDQuery was not handling thrown Errors correctly.
The Error is not catched and therefore not delegated back to the
caller. A caller in that case hangs indefinetely.

fixes #18052

(cherry picked from commit 882cd5c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants