Order Socket V3.04 13-OCT release Issues

I wrote a whole post and Fyers forum was down most of time and then working intermittently so I am not sure if this will be duplicated.

Anyway, todays V3.04 that was supposed to fix problems has now introduced some more issues in Order socket.

Only noticeable fix is with data socket regarding thread join when disconnecting and channel=15 parameter.

I tested the update V3.04 and we still have issues, probably makes it worse

  • When shutting down program and making call to self.fyers.close_connection() fyers_apiv3\FyersWebsocket\order_ws.py line #291 self.fyers.close_connection() #Getting the following exception if self.fyers: self.fyers.close_connection() File "C:\Python\Python39-32\lib\site-packages\fyers_apiv3\FyersWebsocket\order_ws.py", line 428, in close_connection self.__on_close(None) File "C:\Python\Python39-32\lib\site-packages\fyers_apiv3\FyersWebsocket\order_ws.py", line 291, in __on_close time.sleep(self.reconnect_delay) AttributeError: 'FyersOrderSocket' object has no attribute 'reconnect_delay'
  • Another variable not defined that throws Exception fyers_apiv3\FyersWebsocket\order_ws.py #line number 284 and 296 --> variable not defined ----> self.data_logger.debug if self.write_to_file: self.data_logger.debug( f"Response:{f'Attempting reconnect {self.reconnect_attempts} of {self.max_reconnect_attempts}...'}"
  • Major issue: When we call fyers close_connection func instead of disconnecting it is trying to reconnect

temporary fix is to disable restart and large arbitrary reconnect_attempt

def close_connection(self):
        """
        Closes the WebSocket connection 

        """
        
        if self.__ws_object is not None:
			self.restart_flag = 0
			self.reconnect_attempts = 100
        ## rest of the code
  • To fix issue of point #1
time.sleep(self.reconnect_delay)

## change to some integer in seconds or add this variable to class variables

time.sleep( 60 ) 

out of 4 posts, 2 are pending review but point 3 is creating a deadlock because auto reconnect is being triggered when trying to disconnect or close the socket.

and because the timer sleep variable is not defined, auto reconnect is not waiting at all and attempting to connect back to back

@immature_trader @subhajit_bhar

hi can you check these issues?

point #1 post missed for Exception in Order socket

if self.fyers:  self.fyers.close_connection()
  File "C:\Python\Python39-32\lib\site-packages\fyers_apiv3\FyersWebsocket\order_ws.py", line 428, in close_connection
    self.__on_close(None)
  File "C:\Python\Python39-32\lib\site-packages\fyers_apiv3\FyersWebsocket\order_ws.py", line 291, in __on_close
    time.sleep(self.reconnect_delay)
AttributeError: 'FyersOrderSocket' object has no attribute 'reconnect_delay'

Hi @chirag
All issues are noted, thanks for reporting.
We will release a new package for that

Hi @chirag
We released one new package 3.0.5

Please check once and update us.

thank you

Hi Chirag, I hope there are no issues after the upgrade. Please let us know if any arise.