Uzak veritabanı bağlantısı kullanarak Grails 2.4.4, mongo plugin 3.0.2, MongoDB 2.4.10 kullanıyorum. Ben bir MongoDB imleci alıyorum bazı 6000 kullanıcı için bu çalıştırıldıktan sonraMongo CursorNotFound Grails etki alanı ölçütleri üzerinden etkin imleç istisnası
Person.withCriteria { // Line 323
eq("active", true)
order("dateJoined", "asc")
}.each { personInstance ->
// Code to send an email which takes an average of 1 second
}
: Bizim uygulamanın bir parçası olarak
grails {
mongo {
host = "11.12.13.14" // A remote server IP
port = 27017
databaseName = "blogger"
username = "blog"
password = "xyz"
options {
autoConnectRetry = true
connectTimeout = 3000
connectionsPerHost = 40
socketTimeout = 120000
threadsAllowedToBlockForConnectionMultiplier = 5
maxAutoConnectRetryTime=5
maxWaitTime=120000
}
}
}
, bir hizmet metodu 20.000 kullanıcının üzerinde dolaşır ve onlara bir e-posta gönderir istisna:
2015-04-11 07:31:14,218 [quartzScheduler_Worker-1] ERROR listeners.ExceptionPrinterJobListener - Exception occurred in job: Grails Job
org.quartz.JobExecutionException: com.mongodb.MongoException$CursorNotFound: Cursor 1337814790631604331 not found on server 11.12.13.14:27017 [See nested exception: com.mongodb.MongoException$CursorNotFound: Cursor 1337814790631604331 not found on server 11.12.13.14:27017]
at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:111)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: com.mongodb.MongoException$CursorNotFound: Cursor 1337814790631604331 not found on server 11.12.13.14:27017
at com.mongodb.QueryResultIterator.throwOnQueryFailure(QueryResultIterator.java:218)
at com.mongodb.QueryResultIterator.init(QueryResultIterator.java:198)
at com.mongodb.QueryResultIterator.initFromQueryResponse(QueryResultIterator.java:176)
at com.mongodb.QueryResultIterator.getMore(QueryResultIterator.java:141)
at com.mongodb.QueryResultIterator.hasNext(QueryResultIterator.java:127)
at com.mongodb.DBCursor._hasNext(DBCursor.java:551)
at com.mongodb.DBCursor.hasNext(DBCursor.java:571)
at org.grails.datastore.mapping.mongo.query.MongoQuery$MongoResultList$1.hasNext(MongoQuery.java:1893)
at com.test.person.PersonService.sendWeeklyEmail(PersonService.groovy:323)
at com.test.WeeklyJob.execute(WeeklyJob.groovy:41)
at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:104)
... 2 more
Ben dokümantasyon için baktım ve imleç otomatik olarak 20 dakika içinde kapalı olsun o buldum ve günlükleri ile bunu doğruladı zaman, bu istisna tam sonra 20 geldi dakika.
Ancak, 20 dakika içinde otomatik kapanmanın bu davranışı, etkin olmayan imleç için geçerlidir, ancak burada imleç etkin durumdadır.
GÜNCELLEME:
Bazı makaleleri okumak ve bu TCP canlı tutma zaman aşımı bir sorun olabilir, bulundu. Bu yüzden TCP tutkulu zaman aşımını varsayılan 2 saatten 2 dakikaya değiştirdik, ancak yine de sorunu çözmüyor.