Hi
ODP.NET Managed client ONS HA Events does not work if the timezone is +UTC by the looks of it.
On our RAC cluster we have been trying to get ONS HA Events to work to no avail with the ODP.NET Managed client.
Digging deeper we looked at the traffic on wireshark and subscription and events are flowing. Turning on tracing on the ODP.NET side it is logging out an exception from the ODP.NET managed code.
It looks like it trying to create a time span from the +08:00 part of the time string which will never work. So it looks like if you are +UTC then tough luck with ONS HA Events.
We can see the OracleHANotificationManager correctly log the event arrival:
2017-10-10 12:48:11.951635 TID:5 (PRI) (HA) VERSION=1.0 event_type=SERVICEMEMBER service=tmsdev instance=tomsdev_1 database=tomsdev db_domain= host=wsqbddtom01 status=up card=2 reason=USER timestamp=2017-10-10 12:48:11 timezone=+08:00
Shortly after, in the same method, we get an exception logged:
2017-10-10 12:48:11.951635 TID:5 (PRI) (SVC) (ERR) OracleHANotificationManager.HandleEvent() OracleHANotificationManager::HandleEvent() failed. -String was not recognized as a valid TimeSpan.
From what I can see it is the line that would result in something equivalent to “TimeSpan offset = TimeSpan.Parse("+08:00");” , which throws this exception.
This means we (and presumably anybody east of the Greenwich meridian) will not receive those events in code from the ManagedDataAccess client.
Further, as this looks like the lowest level where these events are received I would assume that the entire managed Oracle client will be unaware of these events, so thus unable to react to them as it should in managing the connection pool.
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (EXT) Notification.ctor()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (EXT) ReceiverThread.readNotificationMessage()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (ENT) ONS.deliver()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (ENT) ONS.lookupSubscriber()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (EXT) ONS.lookupSubscriber()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (ENT) Subscriber.deliver()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (ENT) NotificationQueue.enqueue()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (ENT) QueueElement.ctor()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (EXT) QueueElement.ctor()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (EXT) NotificationQueue.enqueue()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (EXT) Subscriber.deliver()
2017-10-10 12:48:11.950638 TID:13 (PRI) (ONS) (EXT) NotificationQueue.internalDequeue()
2017-10-10 12:48:11.950638 TID:10 (PRI) (ONS) (EXT) ONS.deliver()
2017-10-10 12:48:11.950638 TID:13 (PRI) (ONS) (EXT) NotificationQueue.dequeue()
2017-10-10 12:48:11.950638 TID:13 (PRI) (ONS) (EXT) Subscriber.receive()
2017-10-10 12:48:11.950638 TID:5 (PRI) (SVC) (ENT) OracleHANotificationManager.HandleEvent()
2017-10-10 12:48:11.950638 TID:13 (PRI) (ONS) (ENT) Subscriber.receive()
2017-10-10 12:48:11.951635 TID:5 (PRI) (ONS) (ENT) Notification.body()
2017-10-10 12:48:11.951635 TID:13 (PRI) (ONS) (ENT) NotificationQueue.dequeue()
2017-10-10 12:48:11.951635 TID:5 (PRI) (ONS) (EXT) Notification.body()
2017-10-10 12:48:11.951635 TID:5 (PRI) (HA) VERSION=1.0 event_type=SERVICEMEMBER service=tmsdev instance=tomsdev_1 database=tomsdev db_domain= host=wsqbddtom01 status=up card=2 reason=USER timestamp=2017-10-10 12:48:11 timezone=+08:00
2017-10-10 12:48:11.951635 TID:13 (PRI) (ONS) (ENT) NotificationQueue.internalDequeue()
2017-10-10 12:48:11.951635 TID:5 (PRI) (SVC) (ERR) OracleHANotificationManager.HandleEvent() OracleHANotificationManager::HandleEvent() failed. -String was not recognized as a valid TimeSpan.
2017-10-10 12:48:11.951635 TID:5 (PRI) (SVC) (EXT) OracleHANotificationManager.HandleEvent()
2017-10-10 12:48:25.436969 TID:14 (PRI) (ENT) ReceiverThread.Run()
2017-10-10 12:48:25.436969 TID:14 (PRI) (ONS) (ERR) ReceiverThread.Run() (txnid=n/a) System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.Stream.ReadByte()
at OracleInternal.NotificationServices.InputBuffer.get_NextString()
at OracleInternal.NotificationServices.ReceiverThread.Run()
2017-10-10 12:48:25.436969 TID:14 (PRI) (EXT) ReceiverThread.Run()
2017-10-10 12:48:25.436969 TID:14 (PRI) (ONS) (ENT) Connection.closeClientSocket()
2017-10-10 12:48:25.436969 TID:14 (PRI) (ONS) (ENT) ONSTcpClient.Close()
2017-10-10 12:48:25.436969 TID:14 (PRI) (ONS) (EXT) ONSTcpClient.Close()
2017-10-10 12:48:25.436969 TID:14 (PRI) (ONS) (EXT) Connection.closeClientSocket()
Regards
Daniel Rowe