java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread

classic Classic list List threaded Threaded
6 messages Options
yangjiajun yangjiajun
Reply | Threaded
Open this post in threaded view
|

java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread

Hello.

I get a strange exception while test ignite 2.8 in our test env.I get
following exception when I set lazy = true to run our tasks.The tasks do
jdbc selects and insert the result to others ignite tables.The tasks are
async.The exception throws when my code fetches 1024 rows.Such tasks works
well in ignite 2.7.And it also works well when I set lazy = false in ignite
2.8.

This is the exception in client:
java.sql.SQLException: General error:
"java.lang.IllegalMonitorStateException: attempt to unlock read lock, not
locked by current thread" [50000-197]
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:901)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinResultSet.next(JdbcThinResultSet.java:206)
        at
com.zaxxer.hikari.pool.HikariProxyResultSet.next(HikariProxyResultSet.java)
        .....
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

The log in server:
ignite-369ae417.rar
<http://apache-ignite-users.70518.x6.nabble.com/file/t2059/ignite-369ae417.rar>  

Unfortunately,I still can't make a simple reproducer in my locl env.Do u
have any ideas about such exception?





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread

Hi,
  Can you attach a reproducer along w/exact version #s and we will take a
look.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread

In reply to this post by yangjiajun
Hello!

Are you sure that you are not using the same connection from two threads concurrently? Ignite thin connections are non-thread-safe.

Regards,
--
Ilya Kasnacheev


чт, 12 мар. 2020 г. в 11:47, yangjiajun <[hidden email]>:
Hello.

I get a strange exception while test ignite 2.8 in our test env.I get
following exception when I set lazy = true to run our tasks.The tasks do
jdbc selects and insert the result to others ignite tables.The tasks are
async.The exception throws when my code fetches 1024 rows.Such tasks works
well in ignite 2.7.And it also works well when I set lazy = false in ignite
2.8.

This is the exception in client:
java.sql.SQLException: General error:
"java.lang.IllegalMonitorStateException: attempt to unlock read lock, not
locked by current thread" [50000-197]
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:901)
        at
org.apache.ignite.internal.jdbc.thin.JdbcThinResultSet.next(JdbcThinResultSet.java:206)
        at
com.zaxxer.hikari.pool.HikariProxyResultSet.next(HikariProxyResultSet.java)
        .....
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

The log in server:
ignite-369ae417.rar
<http://apache-ignite-users.70518.x6.nabble.com/file/t2059/ignite-369ae417.rar

Unfortunately,I still can't make a simple reproducer in my locl env.Do u
have any ideas about such exception?





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
yangjiajun yangjiajun
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread

Hello.Thanks for u reply.

Actually I am using Hakaricp connection pool.I think my threads can't use
same connection at same time.The threads can only reuse same connection at
different time.My code works well in ignite 2.7 and it also works when I set
lazy=false in ignite 2.8.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Taras Ledkov Taras Ledkov
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread

Hi,

Looks like the issue is related to
https://issues.apache.org/jira/browse/IGNITE-12800.
I've not fixed it yet in Ignite.

Hmm. I guess the error is happen when you select from REPLICATED cache.
Am I right?
Now I recommend don't use 'lazy' mode via JDBC client for local queries
and for query from replicated caches
(because it is transforms to local query).

I suppose we'll fix it at 2.8.1.

On 17.03.2020 4:32, yangjiajun wrote:

> Hello.Thanks for u reply.
>
> Actually I am using Hakaricp connection pool.I think my threads can't use
> same connection at same time.The threads can only reuse same connection at
> different time.My code works well in ignite 2.7 and it also works when I set
> lazy=false in ignite 2.8.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/

--
Taras Ledkov
Mail-To: [hidden email]

yangjiajun yangjiajun
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.IllegalMonitorStateException: attempt to unlock read lock, not locked by current thread

Hello.

Yes,u are right.Thanks a lot for u reply.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/