Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 602794 Details for
Bug 844607
aiccu treats lack of network connectivity on startup as a fatal error
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Updated: Patch AICCU to retry with backoff
aiccu.patch (text/plain), 3.96 KB, created by
Eric Hopper
on 2012-08-07 16:01:31 UTC
(
hide
)
Description:
Updated: Patch AICCU to retry with backoff
Filename:
MIME Type:
Creator:
Eric Hopper
Created:
2012-08-07 16:01:31 UTC
Size:
3.96 KB
patch
obsolete
>diff -r 55acc0fb2d5f -r de0f9acac96b .hgtags >--- /dev/null Thu Jan 01 00:00:00 1970 +0000 >+++ b/.hgtags Mon Aug 06 22:25:24 2012 -0700 >@@ -0,0 +1,1 @@ >+55acc0fb2d5f5eb11ebfeb23b56c256909539f06 2007.01.15 >diff -r 55acc0fb2d5f -r de0f9acac96b common/tic.c >--- a/common/tic.c Mon Aug 06 14:43:05 2012 -0700 >+++ b/common/tic.c Mon Aug 06 22:25:24 2012 -0700 >@@ -60,10 +60,12 @@ > return 0; > } > >-bool tic_Login(struct TIC_conf *tic, const char *username, const char *password, const char *server) >+bool tic_Login(struct TIC_conf *tic, const char *username, const char *password, const char *server, bool test_mode) > { > char buf[1024], sSignature[33], sChallenge[1024]; > int i; >+ int backoff = 1; >+ int retry_count = 0; > #ifndef _WIN32 > struct utsname uts_name; > #else >@@ -76,13 +78,42 @@ > D(dolog(LOG_DEBUG, "Trying to connect to TIC server %s\n", server)); > > /* Connect to the TIC server */ >- tic->sock = connect_client(server, TIC_PORT, AF_INET, SOCK_STREAM); >- if (!tic->sock) >- { >- dolog(LOG_ERR, "Couldn't connect to the TIC server %s\n", server); >+ while (retry_count < 750) { >+ tic->sock = connect_client(server, TIC_PORT, AF_INET, SOCK_STREAM); >+ if (tic->sock) >+ break; >+ >+ /* If it got here, the connection failed. */ >+ if (retry_count <= 0) { >+ /* Only log the first failure. */ >+ dolog(LOG_ERR, "Couldn't connect to the TIC server %s\n", server); >+ } >+ >+ if (test_mode) >+ return false; >+ >+ /* >+ * CEM: if connect_client() fails, the client was unable to >+ * resolve TIC or connect(2) failed. Since we haven't yet >+ * talked to the TIC server across the network, this shouldn't >+ * possibly ddos sixxs. >+ */ >+ sleep(backoff); >+ if (backoff < 120) { >+ backoff = backoff + ((backoff < 2) ? 1 : (backoff / 2)); >+ } >+ ++retry_count; >+ } >+ >+ if (!tick->sock) { >+ dolog(LOG_ERR, "Exhausted all retries for connecting to the TIC server %s\n", server); > return false; > } > >+ if (retry_count > 0) { >+ dolog(LOG_INFO, "Succesfully connected to the TIC server %s\n", server); >+ } >+ > /* Fetch the welcome */ > if (sock_getline(tic->sock, tic_buf, sizeof(tic_buf), &tic_filled, buf, sizeof(buf)) == -1) > { >diff -r 55acc0fb2d5f -r de0f9acac96b common/tic.h >--- a/common/tic.h Mon Aug 06 14:43:05 2012 -0700 >+++ b/common/tic.h Mon Aug 06 22:25:24 2012 -0700 >@@ -120,7 +120,7 @@ > **********************************************************/ > > /* Login to/Logout from the TIC Server */ >-bool tic_Login(struct TIC_conf *tic, const char *username, const char *password, const char *server); >+bool tic_Login(struct TIC_conf *tic, const char *username, const char *password, const char *server, bool test_mode); > void tic_Logout(struct TIC_conf *tic, const char *quitmsg); > > /* Check if the time is in range */ >diff -r 55acc0fb2d5f -r de0f9acac96b unix-console/main.c >--- a/unix-console/main.c Mon Aug 06 14:43:05 2012 -0700 >+++ b/unix-console/main.c Mon Aug 06 22:25:24 2012 -0700 >@@ -77,7 +77,7 @@ > { > struct TIC_sTunnel *hsTunnel, *t; > >- if (!tic_Login(g_aiccu->tic, g_aiccu->username, g_aiccu->password, g_aiccu->server)) return 0; >+ if (!tic_Login(g_aiccu->tic, g_aiccu->username, g_aiccu->password, g_aiccu->server, true/*test_mode=no retry*/)) return 0; > > hsTunnel = tic_ListTunnels(g_aiccu->tic); > >@@ -147,15 +147,16 @@ > * returns a TIC_Tunnel which can then be > * used for configuring and keeping it running > */ >-struct TIC_Tunnel *get_tunnel(void); >-struct TIC_Tunnel *get_tunnel(void) >+struct TIC_Tunnel *get_tunnel(bool); >+struct TIC_Tunnel *get_tunnel(bool test_mode) > { > > struct TIC_sTunnel *hsTunnel, *t; > struct TIC_Tunnel *hTunnel; > > /* Login to the TIC Server */ >- if (!tic_Login(g_aiccu->tic, g_aiccu->username, g_aiccu->password, g_aiccu->server)) return NULL; >+ if (!tic_Login(g_aiccu->tic, g_aiccu->username, g_aiccu->password, g_aiccu->server, test_mode)) >+ return NULL; > > /* > * Don't try to list the tunnels when >@@ -332,7 +333,7 @@ > } > > /* Get our tunnel */ >- hTunnel = get_tunnel(); >+ hTunnel = get_tunnel((mode == A_TEST || mode == A_AUTOTEST)); > > if (!hTunnel) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 844607
:
602614
|
602615
|
602791
| 602794 |
603220
|
713303
|
714220
|
935170