hazelcast / hazelcast-jet

Distributed Stream and Batch Processing
https://jet-start.sh
Other
1.1k stars 205 forks source link

CREATE MAPPING in SQL CLI cannot be interrupted #2786

Open olukas opened 3 years ago

olukas commented 3 years ago

If CREATE MAPPING is trying to create file connector and it's waiting for some reason then it cannot be interrupted (tested with GCS but I guess it will behave similarly for others connector).

Steps for reproduce: Add csv lib from opt to lib and hazelcast-jet/extensions/hadoop-dist/files-gcs/target/hazelcast-jet-files-gcs-4.4-SNAPSHOT-jar-with-dependencies.jar from OS repo to lib and try to call SQL command with missing credentials for GCS:

CREATE MAPPING gcs_files
TYPE File
OPTIONS (
    'path' = 'gs://jet-test-bucket/hazelcast-qe/jet/files',
    'format' = 'csv',
    'glob' = '*.csv'
);

and try to call ctrl+c - it will not interrupt the command. It's will be stucked for ~90seconds until some timeout occurs. We should allow to interrupt the command.

ufukyilmaz commented 3 years ago

This issue is similar to https://github.com/hazelcast/hazelcast-jet/issues/2724

viliam-durina commented 3 years ago

There's no much we can do about it. If the result type is an update count, we can't send the response with queryId to the client earlier before the command is over, and the query ID is needed for cancellation. The client, though can just stop waiting and let the command finish on the server on background. There are some changes in 4.2 which could make this possible, i'm not sure.