Ticket #1190 (closed defect: fixed)
OSYNC_START_TYPE_PROCESS plugin (evo2 as of a few days) not working
| Reported by: | prahal | Owned by: | Graham Cobb |
|---|---|---|---|
| Priority: | high | Milestone: | OpenSync 0.40 |
| Component: | OpenSync: IPC | Version: | 0.39 |
| Severity: | major | Keywords: | |
| Cc: | Graham, Cobb, dgollub |
Description (last modified by prahal) (diff)
With OSYNC_START_TYPE_PROCESS and current code for osplugin.c,
1258044043.078150] <<<<<<< evo2_initialize: 0x8115bb0
[1258044043.078249] >>>>>>> osync_sink_state_db_new(/home/prahal/.config/opensync/0.40/group1/2/anchor.db, contact, 0xbff99eb8)
[1258044043.078321] >>>>>>> osync_db_new(0xbff99eb8)
[1258044043.078396] <<<<<<< osync_db_new: 0x81113d0
[1258044043.078464] >>>>>>> osync_db_open(0x81113d0, /home/prahal/.config/opensync/0.40/group1/2/anchor.db, 0xbff99eb8)
[1258044043.079326] <<<<<<< osync_db_open
[1258044043.079424] >>>>>>> osync_db_table_exists(0x81113d0, tbl_sink_states, 0xbff99eb8)
[1258044043.080810] <<<<<<< osync_db_table_exists: table "tbl_sink_states" exists.
[1258044043.080977] <<<<<<< osync_sink_state_db_new: 0x81113d0
[1258044043.081143] >>>>>>> osync_queue_send_message_with_timeout(0x804e2f8, (nil), 0x80fe108, 0, 0xbff99eb8)
[1258044043.081530] <<<<<<< osync_queue_send_message_with_timeout
while if I add the attached patch (export as public osync_queue_cross_link and use it in osplugin.c for each pipe kind):
[1258047481.329357] <<<<<<< evo2_initialize: 0x8115bb0
[1258047481.329527] >>>>>>> osync_sink_state_db_new(/home/prahal/.config/opensync/0.40/group1/2/anchor.db, contact, 0xbfe296e8)
[1258047481.329667] >>>>>>> osync_db_new(0xbfe296e8)
[1258047481.329734] <<<<<<< osync_db_new: 0x81113d0
[1258047481.329806] >>>>>>> osync_db_open(0x81113d0, /home/prahal/.config/opensync/0.40/group1/2/anchor.db, 0xbfe296e8)
[1258047481.330691] <<<<<<< osync_db_open
[1258047481.330838] >>>>>>> osync_db_table_exists(0x81113d0, tbl_sink_states, 0xbfe296e8)
[1258047481.332133] <<<<<<< osync_db_table_exists: table "tbl_sink_states" exists.
[1258047481.332239] <<<<<<< osync_sink_state_db_new: 0x81113d0
[1258047481.332369] >>>>>>> osync_queue_send_message_with_timeout(0x804e2f8, (nil), 0x80fe108, 0, 0xbfe296e8)
[1258047481.332575] >>>>>>> _osync_queue_remove_pending_reply(0x804e180, 0x80fe108, 0)
[1258047481.332702] Searching for pending message id=-332308000
[1258047481.332790] <<<<<<< _osync_queue_remove_pending_reply
[1258047481.333015] <<<<<<< osync_queue_send_message_with_timeout
that is osync_queue_send_message_with_timeout has a defined queue->cmd_queue and thus _osync_queue_remove_pending_reply is called instead of bypassed.
Hope it is not too confused . It has been a while since I last worked on opensync code. The API change for ipc may not be wanted . But I would need insight to find another way to fix this.
PS : I wonder if external aslo suffer this queue->cmd_queue not defined issue (it is only assigned in osync_queue_cross_link).
Attachments
Change History
Changed 4 years ago by prahal
- Attachment fix_osplugin_plugin_queue.diff added
comment:3 Changed 4 years ago by Graham Cobb
I will leave it up to Daniel whether osync_queue_cross_link should be moved to the public API. I would have thought not, but that will mean osplugin has to use the internal interface.
The functional part of the patch looks good to me, although I haven't tested it (sorry, I am travelling at the moment). I think that external plugins work because they use the client code to connect the queues (but I may be wrong).
We really need some unit tests for process and external plugins. In fact, I see that osplugin.c claims process plugins can run in three different ways -- so we would need to add tests for all of them.
Graham
comment:4 Changed 3 years ago by dgollub
- Status changed from new to assigned
applied patch and started test run ...
Changed 3 years ago by dgollub
- Attachment fix_osplugin_plugin_queue_v2.diff added
Adapted patch, don't include private headers, don't cross-link without pipes
comment:5 Changed 3 years ago by dgollub
- Cc Graham, Cobb, dgollub added
- Owner changed from dgollub to Graham Cobb
- Status changed from assigned to new
Attached you can find a second version of the patch. This version is not including the private client header. There is no need to access the internal structue of OSyncClient since the required pointers are available to the osplugin code anyway (incoming and outgoing pipe).
osync_queue_remove_cross_link never got called. So i didn't exported it.
Moved the queue unref call for the incoming pipe after the cross link call.
Does this make sense?
parahl, could you check if this patch also works for you?

One way to fix the cmd_queue not defined when using osplugin instead of thread