I am looking at some code where data is written to cassandra using
Await.result(casDB.store(someVal), Duration.Inf)
I am seeing OperationTimeoutException and WriteTimeoutException. Say if we had 5 seconds timeout and server didnt respond within 5 second then i can think of these exception. But when duration is set to Inf not able to understand what is the reason for these exception.
There is a configuration named reference.conf in the akka.jar. The default timeout for akka is 5 seconds.
So you should create a new configuration and named it application.conf. set actor->typed->timeout = 3000s
Related
I have started to work on a Spring WebFlux and R2DBC project. Mainly, my code works fine.
But after some elements I am receiving this warning
r2dbc.mssql.client.ReactorNettyClient : Connection has been closed by peer
after this warning I am getting this exception and normally program stops to read from Flux which source is R2DBC driver.
ReactorNettyClient$MssqlConnectionClosedException: Connection unexpectedly closed
My main pipeline like this;
Sinks.Empty<Void> completionSink = Sinks.empty();
Flux<Event> events = service.getPairs(
taskProperties.A,
taskProperties.B);
events
.flatMap(some operation)
.doOnComplete(() -> {
log.info("Finished Job");
completionSink.emitEmpty(Sinks.EmitFailureHandler.FAIL_FAST);
})
.subscribe();
completionSink.asMono().block();
After run, flatMap requesting 256 element as a default, then after fetching trying to request(1) for next signal.
At somewhere between 280. and 320. element it is getting above error. It is not idempotent, sometimes it reads 280 element sometimes it is reading 303, 315 etc.
I think it is about network maybe? But not sure and cannot find the reason. Do I need a pool or something different?
Sorry if I missed anything, in case you want I will try to update here.
Thank you in advance
I have tried to change request size of flatMap to unbounded, adding scheduler, default r2dbc pool but for now I don't have any clue.
My simulation fails to stop until an inbuilt timeout is reached. The default is 3600 seconds. How do I set this to a different time period?
The openCPI version is 2.4.3.
Any suggestions?
This is my first use of OpenCPI.
You can change the default timeout for tests using the Timeout attribute in the Tests element of your test XML like below:
<Tests UseHdlFileIO="true" Timeout="30">
<Case>
<!-- Inputs and Outputs in here -->
</Case>
</Tests>
The timeout is defined in seconds. More information can be found in section 13.3.5 of the OpenCPI Component Development Guide
Is it possible to set the read command timeout when the function argument is an URL source?
Is it possible to set the timeout duration to 5 or 10 sec?
I tried setting connectTimeoutMS and socketTimeoutMS to a low value but it still takes about 20 seconds before my script times out. Am I not using the options correctly? I want the script to exit after 5 seconds.
def init_mongo():
mongo_connection = MongoClient('%s' %MONGO_SERVER, connectTimeoutMS=5000, socketTimeoutMS=5000)
if mongo_connection is None:
return
try:
<code>
except:
<code>
So if anyone comes across this later, I was using the wrong option.
What I was looking for is serverSelectionTimeoutMS
The web page:
https://api.mongodb.com/python/current/api/pymongo/mongo_client.html
says:
connectTimeoutMS: (integer or None) Controls how long (in milliseconds) the driver will wait during server monitoring when connecting a new socket to a server before concluding the server is unavailable. Defaults to 20000 (20 seconds)
(Where "server monitoring" is undefined)
So what? Is connectTimeoutMS sort of like a decoy to keep out the amateurs (like me)
I wrote an actor, using a scheduler each 5 milliseconds to assign a time stamp to a field.
And in test, I found that the result of (System.currentTimeMillis() - timeField) is at least 35
And if I use a scheduleAtFixedRate() method from the Executors.scheduledThreadPool, the result is right.
So is the scheduler delay has a min value ?
Answer: the default tick duration is 100 milliseconds.
ScheduledThreadPoolExecutor uses System.nanoTime():
http://fuseyism.com/classpath/doc/java/util/concurrent/ScheduledThreadPoolExecutor-source.html
See comparison here:
System.currentTimeMillis vs System.nanoTime
Akka has a fairly extensive documentation.
Here's an excerpt:
"The default implementation of Scheduler used by Akka is based on the Netty HashedWheelTimer. It does not execute tasks at the exact time, but on every tick, it will run everything that is overdue. The accuracy of the default Scheduler can be modified by the “ticks-per-wheel” and “tick-duration” configuration properties. For more information, see: HashedWheelTimers."