Skip to content

Commit

Permalink
Fixed deadlock in some situations when reload callbacks are called
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtoobii committed Dec 20, 2022
1 parent d263eff commit 7fd9649
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .debian/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: wg-meta
Version: 0.3.1
Version: 0.3.2
Section: base
Priority: optional
Architecture: all
Expand Down
2 changes: 1 addition & 1 deletion .perl-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.22.0
5.22.4
7 changes: 7 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
0.3.2 2022-12-20 11:07:44 +0100 Tobias Bossert <[email protected]>

-

0.3.2 2022-12-20 Tobias Bossert (tobib at cpan.org)
- Fixed dead lock in some situations when a reload callback is called

0.3.1 2021-07-06 Tobias Bossert (tobib at cpan.org)
- Improved doc
- fix: concurrency test -> added small delay between writes
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.1
0.3.2
2 changes: 1 addition & 1 deletion bin/wg-meta
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ use experimental 'signatures';
use Wireguard::WGmeta::Cli::Router;
use Wireguard::WGmeta::Cli::TerminalHelpers;

our $VERSION = "0.3.1";
our $VERSION = "0.3.2";

local $SIG{__WARN__} = sub($message) {
prettify_message($message, 1);
Expand Down
2 changes: 1 addition & 1 deletion dist.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
cd#!/bin/sh

VERSION=`cat VERSION`

Expand Down
2 changes: 1 addition & 1 deletion lib/Wireguard/WGmeta.pm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ use strict;
use warnings FATAL => 'all';
package Wireguard::WGmeta;

our $VERSION = "0.3.1"; # Do not change manually
our $VERSION = "0.3.2"; # Do not change manually

1;
2 changes: 1 addition & 1 deletion lib/Wireguard/WGmeta/Cli/Router.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use Wireguard::WGmeta::Cli::Commands::Remove;
use base 'Exporter';
our @EXPORT = qw(route_command);

our $VERSION = "0.3.1";
our $VERSION = "0.3.2";

=head2 route_command($ref_list_input_args)
Expand Down
2 changes: 1 addition & 1 deletion lib/Wireguard/WGmeta/Parser/Conf.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use constant INTERNAL_KEY_PREFIX => 'int_';
use base 'Exporter';
our @EXPORT = qw(parse_raw_wg_config INTERNAL_KEY_PREFIX);

our $VERSION = "0.3.1";
our $VERSION = "0.3.2";

=head3 parse_raw_wg_config($file_content, $on_every_value, $on_new_section [, $skip, $wg_meta_prefix, $wg_disabled_prefix])
Expand Down
2 changes: 1 addition & 1 deletion lib/Wireguard/WGmeta/Parser/Middleware.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use Wireguard::WGmeta::Utils;
use base 'Exporter';
our @EXPORT = qw(parse_wg_config2 create_wg_config2);

our $VERSION = "0.3.1";
our $VERSION = "0.3.2";

=head3 parse_wg_config2($config_file_content, $interface_name [, $wg_meta_prefix, $disabled_prefix, $use_checksum])
Expand Down
2 changes: 1 addition & 1 deletion lib/Wireguard/WGmeta/Parser/Show.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use experimental 'signatures';
use base 'Exporter';
our @EXPORT = qw(wg_show_dump_parser);

our $VERSION = "0.3.1"; # do not change manually, this variable is updated when calling make
our $VERSION = "0.3.2"; # do not change manually, this variable is updated when calling make


=head3 wg_show_dump_parser($input)
Expand Down
2 changes: 1 addition & 1 deletion lib/Wireguard/WGmeta/ValidAttributes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use experimental 'signatures';

use Wireguard::WGmeta::Validator;

our $VERSION = "0.3.1";
our $VERSION = "0.3.2";

=head1 ATTRIBUTE TYPES
Expand Down
2 changes: 1 addition & 1 deletion lib/Wireguard/WGmeta/Wrapper/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use Wireguard::WGmeta::ValidAttributes;
use Wireguard::WGmeta::Utils;
use Wireguard::WGmeta::Parser::Conf qw(INTERNAL_KEY_PREFIX);

our $VERSION = "0.3.1"; # do not change manually, this variable is updated when calling make
our $VERSION = "0.3.2"; # do not change manually, this variable is updated when calling make

use constant FALSE => 0;
use constant TRUE => 1;
Expand Down
5 changes: 3 additions & 2 deletions lib/Wireguard/WGmeta/Wrapper/ConfigT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ use constant FALSE => 0;
use constant TRUE => 1;
use constant INTEGRITY_HASH_SALT => 'wefnwioefh9032ur3';

our $VERSION = "0.3.1"; # do not change manually, this variable is updated when calling make
our $VERSION = "0.3.2"; # do not change manually, this variable is updated when calling make

=head3 is_valid_interface($interface)
Expand Down Expand Up @@ -293,9 +293,10 @@ sub commit($self, $is_hot_config = FALSE, $plain = FALSE, $ref_hash_integrity_ke
$self->{parsed_config}{$interface_name}{mtime} = get_mtime($file_name);
$self->{n_conf_files}++ if (defined $is_new);
$self->_reset_changed($interface_name);
# Close file handle before calling reload callbacks, otherwise the exclusive lock is kept!
close $fh;
# Notify listeners about a file change
$self->_call_reload_listeners($interface_name);
close $fh;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Wireguard/WGmeta/Wrapper/Show.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use warnings FATAL => 'all';
use experimental 'signatures';


our $VERSION = "0.3.1";
our $VERSION = "0.3.2";

use constant FALSE => 0;
use constant TRUE => 1;
Expand Down

0 comments on commit 7fd9649

Please sign in to comment.