Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

[LibOS] Spark meets error because of missing syscall fcntl(F_SETLK/F_SETLKW/F_GETLK) #1837

Closed
llly opened this issue Sep 23, 2020 · 4 comments

Comments

@llly
Copy link
Contributor

llly commented Sep 23, 2020

Description of the problem

Trying to run spark using Graphene-SGX and caught Exception Function not implemented.

Steps to reproduce

Run spark executor using Graphene-SGX.

Expected results

Can work.

Actual results

Got following exception:

20/09/23 12:52:12 ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0)
java.io.IOException: Function not implemented
        at java.base/sun.nio.ch.FileDispatcherImpl.lock0(Native Method)
        at java.base/sun.nio.ch.FileDispatcherImpl.lock(FileDispatcherImpl.java:96)
        at java.base/sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:1119)
        at java.base/java.nio.channels.FileChannel.lock(FileChannel.java:1063)
        at org.apache.spark.util.Utils$.fetchFile(Utils.scala:492)
        at org.apache.spark.executor.Executor$$anonfun$org$apache$spark$executor$Executor$$updateDependencies$5.apply(Executor.scala:811)
        at org.apache.spark.executor.Executor$$anonfun$org$apache$spark$executor$Executor$$updateDependencies$5.apply(Executor.scala:803)
        at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:733)
        at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:130)
        at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:130)
        at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:236)
        at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
        at scala.collection.mutable.HashMap.foreach(HashMap.scala:130)
        at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:732)
        at org.apache.spark.executor.Executor.org$apache$spark$executor$Executor$$updateDependencies(Executor.scala:803)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:375)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

The Java code is https://github.com/openjdk/jdk/blob/d7a0fb9ebc898e76207c27166b81630e837a064a/src/java.base/unix/classes/sun/nio/ch/FileDispatcherImpl.java#L96
I searched the log and found failed syscall

shim_fcntl(278,F_SETLKW,0x9a8462db0) = -38

because fcntl(F_SETLK/F_SETLKW/F_GETLK) are not implemented.
https://github.com/oscarlab/graphene/blob/f94c72b8f55918aff6e7b0b45b1487f216039245/LibOS/shim/src/sys/shim_fcntl.c#L173-L175

@mkow
Copy link
Member

mkow commented Sep 23, 2020

This is a duplicate of #437, closing. If you want to highlight the fact that this specific workload needs this functionality please comment under #437.

@mkow mkow closed this as completed Sep 23, 2020
@llly
Copy link
Contributor Author

llly commented Sep 24, 2020

It blocks Spark usage in Graphene. I'm glad to see that we have put it into production TODO list.

@debin-yang
Copy link

Suggest give those TODO tasks higher priority and start addressing it earlier. This is a blocking issue of Graphene to be used by the targeted usage which uses Spark and Graphene. Workaround is identified and can work temporarily for POC of the usage but the workaround will not work for production of the usage.

@mkow
Copy link
Member

mkow commented Sep 24, 2020

@llly @debin-yang Please move the discussion to #437, so that we have everything about file locking in one place.

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

No branches or pull requests

3 participants