Closed Nyu2Y closed 13 years ago
if syncJournal is not 0 or max, the promise should be added to the "promise list" (promises). then the periodic timer on line 20 will call fsync, which sets the promise values on line 31.
i have a problem , why 'if (allowSync) future() ' futrue with ''()''?
whats the different between future() and future at in kestrel / src / main / scala / net / lag / kestrel / Journal.scala line:471
future() causes it to block, waiting for the future to be fulfilled.
when queueConfig.sycnJournal not equal 0.seconds or Duration.maxValue, Journal will not work PersistentQueueSpec will stop at queue.remove , and not retrun . because :
future with "()" , it will wait for result to call apply , but in kestrel / src / main / scala / net / lag / kestrel / PeriodicSyncFile.scala <line: 60> promise is without promise.setValue(()) .
change
kestrel / src / main / scala / net / lag / kestrel / Journal.scala line:471 if (allowSync) future() to if (allowSync) future it seems work well .
I am not familiar with promise , please check it . wait your comment .