[ 
https://issues.apache.org/jira/browse/IGNITE-9379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17154581#comment-17154581
 ] 

Aleksey Plekhanov commented on IGNITE-9379:
-------------------------------------------

I've tried locally the following test with {{-Xmx64m}} JVM option:
{code:java}
@Test
public void testOomOnSql() throws Exception {
    IgniteConfiguration cfg = Config.getServerConfiguration();

    cfg.setDataStorageConfiguration(new 
DataStorageConfiguration().setDefaultDataRegionConfiguration(
        new DataRegionConfiguration().setMaxSize(1024L * 1024 * 1024)
    ));

    try (Ignite ignite = Ignition.start(cfg)) {
        try (IgniteClient client = Ignition.startClient(new 
ClientConfiguration().setAddresses(Config.SERVER))) {
            client.query(
                new SqlFieldsQuery(String.format(
                    "CREATE TABLE IF NOT EXISTS Person (id INT PRIMARY KEY, 
name VARCHAR) WITH \"VALUE_TYPE=%s,CACHE_NAME=%s\"",
                    Person.class.getName(), "test"
                )).setSchema("PUBLIC")
            ).getAll();

            try (IgniteDataStreamer<Integer, Person> streamer = 
ignite.dataStreamer("test")) {
                for (int i = 0; i < 300_000; ++i)
                    streamer.addData(i, new Person(i, "Person Name " + i));
            }

            client.query(new SqlFieldsQuery("SELECT name FROM 
Person").setSchema("PUBLIC").setPageSize(50_000)).getAll();
        }
    }
}
{code}
OOME is fired from different threads (discovery workers, NIO workers, timeout 
workers, client-connectors, etc) and processed by failure handler for every run 
(some threads skip OOM processing, but the error is still handled by other 
threads).

One of the caught exception was the same as on dev-list, but now it's processed 
by failure handler properly and node stopped:
{noformat}
[client-connector-#77%20d801e6-4863-484b-867f-ee5bec18ea2c%][] Critical system 
error detected. Will be handled accordingly to configured handler 
[hnd=StopNodeOrHaltFailureHandler [tryStop=false, timeout=0, 
super=AbstractFailureHandler [ignoredFailureTypes=UnmodifiableSet 
[SYSTEM_WORKER_BLOCKED, SYSTEM_CRITICAL_OPERATION_TIMEOUT]]], 
failureCtx=FailureContext [type=CRITICAL_ERROR, err=java.lang.OutOfMemoryError: 
Java heap space]]java.lang.OutOfMemoryError: Java heap space
    at 
org.apache.ignite.internal.binary.streams.BinaryMemoryAllocatorChunk.reallocate(BinaryMemoryAllocatorChunk.java:69)
    at 
org.apache.ignite.internal.binary.streams.BinaryHeapOutputStream.ensureCapacity(BinaryHeapOutputStream.java:65)
    at 
org.apache.ignite.internal.binary.streams.BinaryAbstractOutputStream.writeByteArray(BinaryAbstractOutputStream.java:50)
...{noformat}
Also, I've found one more place where OOME for thin clients can be handled 
(grid-nio-worker-client-listener), added handler to 

{{ClientListenerNioListener}} class.

> Ignite node hangs after OOM in a thread from thin client thread pool
> --------------------------------------------------------------------
>
>                 Key: IGNITE-9379
>                 URL: https://issues.apache.org/jira/browse/IGNITE-9379
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.6
>            Reporter: Taras Ledkov
>            Assignee: Aleksey Plekhanov
>            Priority: Critical
>             Fix For: 2.9
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> OOM exception handler isn't set up for thin client thread pool.
> The issue is described in details at the [dev 
> list|http://apache-ignite-evelopers.2346864.n4.nabble.com/Binary-Client-Protocol-client-hangs-in-case-of-OOM-on-server-td34224.html].



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to