NewTec-GmbH / pyJiraCli

pyJiraCli is a command-line tool designed for handling Jira tickets efficiently.
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

fix timeout for server login #31

Closed Timuuc closed 5 months ago

Timuuc commented 5 months ago

The timeout for the server login is too long. Adjust timeout to about 10 seconds in case the login is unsuccessful.

gabryelreyes commented 5 months ago

The jira.client.JIRA class provides the possibility to define the maximum number of retries and the timeout time (in unknown units) for the connection with the Jira server. Following values have been tried.

max_retries timeout Measured timeout
1 0.1 11.90
1 1 16.53
1 2 26.40
1 0.01 14.17
3 0.1 74.35

As observed, the variables have some influence over the timeout, however it is not possible to determine a fixed time. No other variables are available to control this time.

Example in code:

self._jira_obj = JIRA(server=self._server_url, options={'verify': self._cert_path},  token_auth=token, max_retries=max_retries, timeout=timeout)

For this reason, the values that produced the shortest time will be chosen, until a better solution is found.

gabryelreyes commented 5 months ago

Long and inconsistent timeouts are related to this sleep https://github.com/pycontribs/jira/blob/eb0ec90e08ae24823e266b0128b852022d212982/jira/resilientsession.py#L343