Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e45f8857
Commit
e45f8857
authored
Dec 13, 2004
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed event thread for better error handling
parent
4b6a7521
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
11 deletions
+30
-11
ndb/src/mgmclient/CommandInterpreter.cpp
ndb/src/mgmclient/CommandInterpreter.cpp
+30
-11
No files found.
ndb/src/mgmclient/CommandInterpreter.cpp
View file @
e45f8857
...
...
@@ -465,6 +465,7 @@ event_thread_run(void* m)
int
fd
=
ndb_mgm_listen_event
(
handle
,
filter
);
if
(
fd
>
0
)
{
do_event_thread
=
1
;
char
*
tmp
=
0
;
char
buf
[
1024
];
SocketInputStream
in
(
fd
,
10
);
...
...
@@ -474,6 +475,10 @@ event_thread_run(void* m)
ndbout
<<
tmp
;
}
while
(
do_event_thread
);
}
else
{
do_event_thread
=
-
1
;
}
my_thread_end
();
NdbThread_Exit
(
0
);
...
...
@@ -494,24 +499,38 @@ CommandInterpreter::connect()
&&
!
ndb_mgm_connect
(
m_mgmsrv2
,
try_reconnect
-
1
,
5
,
1
))
{
m_connected
=
true
;
if
(
m_verbose
)
{
printf
(
"Connected to Management Server at: %s:%d
\n
"
,
host
,
port
);
}
{
do_event_thread
=
1
;
assert
(
m_event_thread
==
0
);
assert
(
do_event_thread
==
0
);
do_event_thread
=
0
;
m_event_thread
=
NdbThread_Create
(
event_thread_run
,
(
void
**
)
&
m_mgmsrv2
,
32768
,
"CommandInterpreted_event_thread"
,
NDB_THREAD_PRIO_LOW
);
if
(
m_event_thread
!=
0
)
{
int
iter
=
1000
;
// try for 30 seconds
while
(
do_event_thread
==
0
&&
iter
--
>
0
)
NdbSleep_MilliSleep
(
30
);
}
if
(
m_event_thread
==
0
||
do_event_thread
==
0
||
do_event_thread
==
-
1
)
{
printf
(
"Warning, event thread startup failed, degraded printouts as result
\n
"
);
do_event_thread
=
0
;
}
}
else
{
ndb_mgm_disconnect
(
m_mgmsrv
);
printf
(
"Warning, event connect failed, degraded printouts as result
\n
"
);
}
m_connected
=
true
;
if
(
m_verbose
)
{
printf
(
"Connected to Management Server at: %s:%d
\n
"
,
host
,
port
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment