Merge lp:~denisboyun/drizzle/main_cc_change_part3 into lp:drizzle

Proposed by denis
Status: Merged
Approved by: Brian Aker
Approved revision: 2565
Merged at revision: 2576
Proposed branch: lp:~denisboyun/drizzle/main_cc_change_part3
Merge into: lp:drizzle
Diff against target: 87 lines (+27/-1)
3 files modified
drizzled/main.cc (+7/-1)
drizzled/signal_handler.cc (+19/-0)
drizzled/signal_handler.h (+1/-0)
To merge this branch: bzr merge lp:~denisboyun/drizzle/main_cc_change_part3
Reviewer Review Type Date Requested Status
Olaf van der Spek (community) Needs Fixing
Drizzle Trunk Pending
Review via email: mp+109214@code.launchpad.net

This proposal supersedes a proposal from 2012-06-02.

Description of the change

I moved the function which handles sigint signal into drizzled/signal_handler.cc. I don't know that is your had you in mind.

To post a comment you must log in.
Revision history for this message
Brian Aker (brianaker) wrote : Posted in a previous version of this proposal

Let me take a look (I am on vacation, so responses are likely to be slow).

Revision history for this message
Brian Aker (brianaker) wrote : Posted in a previous version of this proposal

Better :)

We can go with this, though the end game is to create just one signal handle thread.

Revision history for this message
Brian Aker (brianaker) wrote : Posted in a previous version of this proposal

Whomever does the next pass can merge the two execution paths.

Revision history for this message
denis (denisboyun) wrote : Posted in a previous version of this proposal

What kind of executions paths you mean? You can show me a simple example that you have in mind? "...though the end game is to create just one signal handle thread." - it mean all function for signal handler situated in plugin/signal_handler.cc?

Revision history for this message
Brian Aker (brianaker) wrote : Posted in a previous version of this proposal

Merge conflict:

RevisionState revno:2564 revid:<email address hidden>
[workspace] $ /bin/sh -xe /tmp/hudson1872514504908144755.sh
+ bzr merge lp:~denisboyun/drizzle/main_cc_change_part3
 M drizzled/main.cc
 M drizzled/signal_handler.cc
 M drizzled/signal_handler.h
Text conflict in drizzled/main.cc
1 conflicts encountered.
Build step 'Execute shell' marked build as failure
Notifying upstream projects of job completion
Finished: FAILURE

Revision history for this message
denis (denisboyun) wrote : Posted in a previous version of this proposal

denis@denis-1001PXD:~/build/drizzle$ bzr merge lp:~denisboyun/drizzle/main_cc_change_part3
 M drizzled/main.cc
 M drizzled/signal_handler.cc
 M drizzled/signal_handler.h
All changes applied successfully.

All done. all conflicts are resolved...Hingo, thank you very much for you help

Revision history for this message
Olaf van der Spek (olafvdspek) wrote :

> #define DRIZZLE_UNIX_SOCKET_PATH "/tmp/mysql.socket"

Macros are evil, just use a static const char*.

review: Needs Fixing
Revision history for this message
denis (denisboyun) wrote :

> > #define DRIZZLE_UNIX_SOCKET_PATH "/tmp/mysql.socket"
>
> Macros are evil, just use a static const char*.

Ok, I understand thank you. Maybe, you help me, I said about plugin signal handler. How to crete one signal handler thread (I mean previous posted from Brian). Maybe you tell me what does it mean?

Revision history for this message
Olaf van der Spek (olafvdspek) wrote :

I'm nto sure what Brian means by that.

Revision history for this message
denis (denisboyun) wrote :

I understand, maybe stupid question but maybe you know there are some helpful resource how to write plugin to drizzle(or maybe some similar resource)?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/main.cc'
2--- drizzled/main.cc 2012-06-04 12:18:56 +0000
3+++ drizzled/main.cc 2012-06-07 18:58:22 +0000
4@@ -81,6 +81,7 @@
5 extern bool opt_daemon;
6
7
8+
9 /**
10 All global error messages are sent here where the first one is stored
11 for the client.
12@@ -219,9 +220,14 @@
13 sigprocmask(SIG_UNBLOCK,&set,NULL);
14 pthread_sigmask(SIG_UNBLOCK,&set,NULL);
15
16+ sa.sa_handler = drizzled_sigint_handler;
17+ sigaction(SIGINT,&sa,NULL);
18+
19 return;
20 }
21
22+
23+
24 static void GoogleProtoErrorThrower(google::protobuf::LogLevel level,
25 const char* ,
26 int, const string& ) throw(const char *)
27@@ -291,9 +297,9 @@
28 init signals & alarm
29 After this we can't quit by a simple unireg_abort
30 */
31+
32 init_signals();
33
34-
35 select_thread= pthread_self();
36 select_thread_in_use=1;
37
38
39=== modified file 'drizzled/signal_handler.cc'
40--- drizzled/signal_handler.cc 2011-07-14 22:12:02 +0000
41+++ drizzled/signal_handler.cc 2012-06-07 18:58:22 +0000
42@@ -34,7 +34,10 @@
43 #include <drizzled/statistics_variables.h>
44 #include <drizzled/system_variables.h>
45
46+#define DRIZZLE_UNIX_SOCKET_PATH "/tmp/mysql.socket"
47+
48 using namespace drizzled;
49+namespace fs= boost::filesystem;
50
51 static uint32_t killed_threads;
52 static bool segfaulted= false;
53@@ -48,6 +51,22 @@
54 extern "C"
55 {
56
57+void drizzled_sigint_handler(int sig){
58+ struct sigaction sa;
59+ switch(sig){
60+ case SIGINT:{
61+ if (fs::exists(DRIZZLE_UNIX_SOCKET_PATH))
62+ {
63+ fs::remove(DRIZZLE_UNIX_SOCKET_PATH);
64+ }
65+ sa.sa_handler=SIG_DFL;
66+ sigaction(SIGINT, &sa, NULL);
67+ pthread_kill(pthread_self(),SIGINT);
68+ break;
69+ }
70+ }
71+}
72+
73 void drizzled_print_signal_warning(int sig)
74 {
75 if (global_system_variables.log_warnings)
76
77=== modified file 'drizzled/signal_handler.h'
78--- drizzled/signal_handler.h 2011-03-14 05:40:28 +0000
79+++ drizzled/signal_handler.h 2012-06-07 18:58:22 +0000
80@@ -28,6 +28,7 @@
81 extern "C" void drizzled_print_signal_warning(int sig);
82 extern "C" void drizzled_handle_segfault(int sig);
83 extern "C" void drizzled_end_thread_signal(int sig);
84+extern "C" void drizzled_sigint_handler(int sig);
85
86 /*
87 posix sigaction() based signal handler implementation

Subscribers

People subscribed via source and target branches

to all changes: