move port creation to Erlang to fix issue #9 #11

Merged
merged 1 commit into from Jun 17, 2013

Projects

None yet

4 participants

@vinoski
Contributor
vinoski commented May 16, 2013

With R16B changes related to locking within the area of port drivers seemed
to result in the syslog driver hanging on the driver_create_port call. To
avoid this, move port creation and closing from C into Erlang. Rework the
driver control interface to simplify the open call to just the setting of
the logopt and facility on a new port. Remove the opening and closing of a
port in the gen_server init and terminate as that port is no longer needed
to communicate with the driver. Move the open call out of the gen_server
and do it in the caller's process instead.

@vinoski vinoski move port creation to Erlang to fix issue #9
With R16B changes related to locking within the area of port drivers seemed
to result in the syslog driver hanging on the driver_create_port call. To
avoid this, move port creation and closing from C into Erlang. Rework the
driver control interface to simplify the open call to just the setting of
the logopt and facility on a new port. Remove the opening and closing of a
port in the gen_server init and terminate as that port is no longer needed
to communicate with the driver. Move the open call out of the gen_server
and do it in the caller's process instead.
28e26bc
@jlouis
jlouis commented May 17, 2013

Looks good to me. Testing it in a production environment, hehe

@istr
istr commented May 30, 2013

Hello, I tested this pull request. Works for me using R16B on a 64bit linux machine. Please pull it. Thx.

@Vagabond
Owner

Can we just remove the gen_server entirely now?

@vinoski
Contributor
vinoski commented May 30, 2013

The gen_server still loads the port driver.

@Vagabond
Owner

Could we just load/unload the port driver in application start/stop, though?

@vinoski
Contributor
vinoski commented Jun 13, 2013

Sure, you can move it. I didn't want to try to do something like that without your input.

@istr istr referenced this pull request in erlang-lager/lager Jun 16, 2013
Closed

lager app doesn't start / freezes on R16B. Is R16B supported? #149

@Vagabond Vagabond merged commit 1db6c4e into Vagabond:master Jun 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment