-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RethinkDbPublisher, define timeout #152
Comments
Maybe we could use an class RethinkDbPublisher(
...
/**
* Executor to schedule a task in Background
*/
private val executor: ExecutorService
): Publisher {
...
override fun publish(report: ExecutionReport) {
...
try {
// Executes the task.
executor.execute { publishData(report) }
// Don't wait for new tasks, execute only what we have.
executor.shutdown()
// Give 30 seconds for all pending tasks to finish.
executor.awaitTermination(30, TimeUnit.SECONDS)
} catch (e: Exception) {
logTracker.error("RethinkDbPublisher- Error executing the Runnable: ${e.message}")
}
}
private fun publishData(report: ExecutionReport) {
logTracker.log(TAG, "================")
logTracker.log(TAG, "RethinkDbPublisher")
logTracker.log(TAG, "publishBuildMetrics: ${rethinkDbPublisherConfiguration.publishBuildMetrics}")
logTracker.log(TAG, "publishTaskMetrics: ${rethinkDbPublisherConfiguration.publishTaskMetrics}")
logTracker.log(TAG, "================")
...
}
...
} The timeout could be set as a constructor property in the |
Also, this issue may also happen with other executors like It would be interesting to create a common implementation for those |
Hi @mokkun This bring to your second point about the "Network" implementation for the interface Publisher. I'm absolutely agree. Talaiot needs to implement a consistent network layer.
Do you have more notes? @MyDogTom do you have any suggestions/notes for this rework of the Network Layer? So, thank you very much for this proposals, I really appreciate it. |
Sorry I'm afraid I don't have enough knowledge to give a valuable input here. I'll definitely take a closer look at the implementation to learn more.
with |
One idea would be to provide these publishers as external plugins to Talaiot. These publishers are very specific IMO, and many projects won't use them. The main module of Talaiot could provide the base APIs for those plugins, but the network logic and dependencies would be contained in them, instead of in the main module.
Sounds good to me. 👍 |
Hi, it sounds good the detachment of the publisher by offering a new dependency. Given the scope of the changes, I've created a new milestone to publish the 2.0 release version. At the moment I included two new issues: |
When there are problems of connectivity with
RethinkDbPublisher
executions hangs with:Check timeout options in RethinkDbPublisher
The text was updated successfully, but these errors were encountered: