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

Graalvm Isolate thread blocking #33

Closed
geek29 opened this issue Jul 3, 2019 · 1 comment
Closed

Graalvm Isolate thread blocking #33

geek29 opened this issue Jul 3, 2019 · 1 comment

Comments

@geek29
Copy link

geek29 commented Jul 3, 2019

I am trying out native-netty-plot demo which is about running java code in native-image isolates. I made some changes in the demo after which example is blocking. HTTP Client making requests to netty server is blocking waiting for response. On further investigation, I found out code is blocking on Isolates.tearDownIsolate(renderingContext); call.

Below is the original code which I modified - mainly using logger library logback and making network call using Apach Http clients. I would like to know under what circumstances tearDownIsolate call will block? and How to investigate it further.

@CEntryPoint
    private static ObjectHandle plotAsSVG(@CEntryPoint.IsolateThreadContext IsolateThread renderingContext, IsolateThread nettyContext, ObjectHandle functionHandle, double xmin, double xmax) {
        //long initialMemory = printMemoryUsage("Rendering isolate initial memory usage: ", 0);

        / * Resolve and delete the functionHandle, now that execution is in the rendering isolate. * /
        String function = ObjectHandles.getGlobal().get(functionHandle);
        ObjectHandles.getGlobal().destroy(functionHandle);

        //byte[] svgBytes = ImageSingletons.lookup(Graphics2DPlotter.class).plotAsSVG(function, xmin, xmax);
        byte[] svgBytes = ImageSingletons.lookup(XYZRunner.class).run(function, xmin, xmax);

        ObjectHandle byteBufferHandle;
        try (PinnedObject pin = PinnedObject.create(svgBytes)) {
            byteBufferHandle = createByteBuffer(nettyContext, pin.addressOfArrayElement(0), svgBytes.length);
        }

        //printMemoryUsage("Rendering isolate final memory usage: ", initialMemory);

        return byteBufferHandle;
    }
@geek29
Copy link
Author

geek29 commented Jul 4, 2019

Network connection being open caused isolate teardown block. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant