I am looking at the recovery actions settings and there are a couple of things that I need clarified.
If I have 0 days as my reset fail count after, and have the following as my actions:
Restart the Service - on first failure
Restart the Service - on second failure
Reboot the Computer - on subsequent failures
Does the fail count get reset on a successful restart of the service?
Does the fail count get reset on the first failure? Hence never having a chance to perform the second or third actions?
On the third successive failure, the computer gets rebooted, the service get started and then fails again; would this reboot the computer again?
Thanks in advance!
Jaime
Setting "Reset fail count after:" to 0 means "reset the fail count to 0 after each failure". This effectively disables both the "second failure" and "subsequent failure" actions and you will always get the "first failure" action.
I've tested that fail count on windows XPE. When the service run and I make it fail with "End Process" of the Windows task Manager. I have defined 3 recovery actions:
restart service
reboot
run a program
On the first "end of process", the service is well restarted. OK.
On the second "end of process", the compuer is rebooted. OK.
After the reboot, if I end the process again, it is restarted and if I end it again, the computer is rebooted.
So it seems that this failure counter is reset after every reboot of the computer...
I precise that my fail count is configured to reset after 1 day.
Related
message":"Error creating RDP session.","details":"This may be due to multiple reasons. To continue, please\n\n1. Please check the number of max session count is configured for this machine\n2. Please find out if no one else has RDP on the machine\n3. Please check that there are no other processes holding RDP connection on the machine\n\nIf you continue to see this message, please contact your system administrator.","correctiveAction":"","code":"rdp.error
I keep getting this error after scheduling the bot, it fails immediately and gives this error
I have tried installing RDP sessions but still does not help
TL;DR: Rails-server restarts aren't handled gracefully in Action Cable, resulting in corrupted state. How to fix that?
I run a Rails server which uses Action Cable, among other things.
When I change a file, the server restarts as expected. But it doesn't exactly restart gracefully.
The Action Cable connection logs {"type":"disconnect","reason":"server_restart","reconnect":true} in the established socket. Then the socket appears to be cut and my channel's unsubscribed method does not run. Upon reconnect, however, the subscribed method does run—as it should, but now we have an asymmetry. Something as simple as keeping track of the number of connected clients has become unreliable because upon a server restart that number will now double although the true number remained the same. That's because it gets to increment the count when subscribed is called, but decrementing the counter happens in unsubscribed, which is not called when the server restarts.
If this only happened in development, it wouldn't be a huge issue, but it happens in production as well during server restarts caused by deployments.
How do I tell Rails to restart the server gracefully, by which I mean it should also run the unsubscribed method in my channel instead of just cutting the connection?
EDIT: I've also filed an issue with Rails: https://github.com/rails/rails/issues/41005
I have an application that uses mqtt for communication between modules and with a mobile terminal.
In some situations when the messages do not arrive, the node performs a self test of MQTT (sending a msg to itself), and when the selftest fails, tries to reconnect to the broker (mqtt offline not always arrives). And then two problems may arise:
If I perform a mqtt.client:close() to assure that the client is closed (to avoid the second problem) and the client is already closed, the node resets.
If I perform a mqtt.client:connect() and the client is still connected, an exception and a restet occurs.
is there a way to know if the mqtt client is connected or not?
Thanks for your comment. I am going to describe what I am doing, to see if you can help me:
I have two independent system, a master and a slave. The master publish a test message every 10 minutes. If there is no answer from the slave. it publish a test message to itself. If this self test does not arrive, a disconnection from the broker is assumed, and a reconnection is initiated.
And here is where the problem comes, sometimes the client is disconnected and everything go well, but sometimes it is still connected but unresponsive, and the node resets with an exception "already connected".
Performing a mqtt:close() previously to the reconnection, should be safe, but if I send it and the client is truly disconnected, the node resets without any reason (known to me).
All this is happening without receiving any offline message.
Instead of waiting for messages manually sent by the master client (which could fail to send for various reasons, leading a listening device to the wrong conclusion about the state of its connection to the broker), I recommend using MQTT's built-in connection management.
First, you can make sure that each client's initial connection has succeeded by including an error handler in :connect(). If the client really opens, nothing in the NodeMCU documentation indicates that it will close itself; it may go offline.
Once connected, the client only knows that something is wrong when it sends a message and does not receive a response. It sounds like you are not calling :publish() much (which would otherwise let you know by returning false), so pinging may be best. If you expect to receive a message from the broker every n seconds, set a keepalive time slightly higher than that on the client.
Then, failure to get a response to those messages should trigger an event that you can respond to. That might be something like the following (not tested, may work better called outside the callback):
m:on("offline", function(client) m:close() end)
I have an ios app that sends a command to a php script listening on a windows 2008server with wamp 2.5. If no response comes back in X seconds it sends back the command to the server. Each command contains also a session identifier.
The problem appears when the 2nd command sent to the server executes before the first. This way it alters the session identifier of the user that sent both commands, and when the 1st command tries to execute, it says the session id is incorrect.
Usually this scenario happens on peak moments when many users connect and thus the delay of the 1st command.
What is the proper way to handle these commands delays of the same user? Or queue them or manage them from apache?
I developed a windows service that must logon to a server. It works fine. I set it to start automatically when the windows starts.
The problem is when there is no network avaliable, generating a "logon failure". This service MUST run 24hours a day, 365 days a year.
How can I avoid this service from crashing when it trys to logon, but can't reach the server?
Thanks.
Do a try...catch block, and set up a timer for say 30 seconds to retry.