477 Commits (d9af302417d585448caf444a67b661e3b4b9f372)
 

Author SHA1 Message Date
Sayan Nandan d9af302417 Don't use additional scope 3 years ago
Sayan Nandan fb503e2981 Fix trying to unlock `file` instead of `file2`
Silly me, `file` has already been unlocked
3 years ago
Sayan Nandan 1180de3b71 Ret FileLock from BGSave to unlock before flush_db 3 years ago
Sayan Nandan 5df31287da Use dedicated blocking osthread for unlocking file
This commit ensures that the file unlock operation is completed as soon
as bgsave returns and not in the future
3 years ago
Sayan Nandan 39ab1e7683 Log error that causes `flush_db` to fail 3 years ago
Sayan Nandan 3407f1e971 Change wd to artifacts to package bundle 3 years ago
Sayan Nandan 44e88518cf Fix artifact packaging
The upload-release-asset action only supports files and not entire dirs.
I had expected it to zip an item if it were a directory; but I was wrong
This commit zips everything before attempting to upload the artifacts
3 years ago
Sayan Nandan 16a19106cb Fix release script to hardcode artifact names
GHA doesn't support using env for matrix.include vars
3 years ago
Sayan Nandan 99826b8b02
Add release script for 32-bit targets (#138) 3 years ago
Sayan Nandan ec74b8118e Fix link [ci skip] 3 years ago
Sayan Nandan 0673192d51
Auto parse input from netsh to find reserved ports (#137)
This commit attempts to fix testing on Windows. It does this by parsing
output from `netsh interface ipv4 show excludedportrange protocol=tcp`
to find the port ranges that were reserved by this specifc Windows host
and then adds these ports to the set of already used ports (`in_set`) to
avoid allocating them to a test function.
3 years ago
Sayan Nandan 379660f14c
Add testing for new Tier 1 targets (#135)
* Add support for new T1 platforms

This commit adds support for the following Tier-1 (T1) platforms:
- i686-unknown-linux-gnu
- i686-pc-windows-msvc

* Fix channel and add explicit target in cargo test

* Use `target add` to add $matrix.rust target

* Use actions-rs/toolchain to install rust

* Install musl-tools to test musl

* Simplify matrix

* Add 32-bit targets and refactor workflow

* Fix build matrix

* Explicitly specify target in cargo test

* Use rustup to install toolchain

* Install 32 bit tools on Linux

* Remove ports in [49000,50000] on Windows
3 years ago
Sayan Nandan a2d98c2bcb
Revert "Create Dependabot config file (#27)" (#134)
This reverts commit c4f00de5b5.
3 years ago
Sayan Nandan bd9649ed05
Update CODEOWNERS 3 years ago
Sayan Nandan f379807365 Disable high port blocking 3 years ago
Sayan Nandan 07dd884f3c Upgrade deps and remove unused regex in cli
Closes #128, closes #129 and closes #132
3 years ago
Sayan Nandan db23c14570 Fix gitter and discord links 3 years ago
Sayan Nandan 4354bfc0f9 Fix ECONNRESET errors on Windows
As discussed in #110, this commit suppresses ECONNRESET on Windows.
3 years ago
Sayan Nandan ea1381269b Don't use filename `con`
Windows is the most ingenious OS in the world where filenames can
conflict with shell commands. That's right, con is an I/O device on
Windows and cannot be used for a filename! This is why we were having
checkout errors on Windows!

Vive la POSIX!
3 years ago
Sayan Nandan d3a612e815 Terminate con when exit or ctrl_c sig is received 3 years ago
Sayan Nandan cfc23d69d9 Close connection on receiving ctrl_c 3 years ago
Sayan Nandan 86fe99a1c4
Merge pull request #131 from skytable:generic-con
Implement generic connections
3 years ago
Sayan Nandan e918dabf26 Use generic Connection replacing SSL/TCP variants
We have introduced a trait `BufferedSocketStream` that is a 'dummy'
trait and is implemented for both `SslStream<TcpStream>` and
`TcpStream`. So, the generic `Connection` object accepts any type that
implements the `BufferedSocketStream` trait (and hence should also
implement `AsyncWrite`)
3 years ago
Sayan Nandan 4ba5418120 Document `dbnet::con` 3 years ago
Sayan Nandan ef36351428 Refactor dbnet and protocol into logical modules 3 years ago
Sayan Nandan eb71335a62 Upgrade all functions to use generic connections
This commit does a LOT! It migrates the `queryengine::execute_simple`,
`CoreDB::execute_query` and the kvengine functions to use generic
connections.

The object dbnet::Con was removed because it isn't needed anymore.
The listeners were also upgraded to use the generic connection handler
3 years ago
Sayan Nandan c399ae1f1c Implement a generic con handler and rename traits
The trait `Con` and `ConOps` were renamed to `ProtocolConnectionExt`
and `ProtocolConnection`.

This naming scheme clearly explains that the Ext version 'augments' the
non-Ext impl. This is the very case here: ProtocolConnection provides
the basic funtions needed for interfacing with net I/O while the Ext
trait enables high-level interaction with the protocol and ultimately
queries.

A generic `ConnectionHandler` object was added that will replace the
SSL and non-SSL handler objects, again reducing redundancy.

Dummy execute functions were added to CoreDB and queryengine.
3 years ago
Sayan Nandan ba478b9f5a Add a generic implementation for a connection
This commit defines two traits: `Con` and `ConOps`. Implementors of
`ConOps` get a free implementation for `Con`. `Con` is the ultimate
object that can be used in place of the current SSL/non-SSL connection
objects. If you look at the implementations of the current connection
objects, they have a lot of repetition as they do almost the same thing
except for the fact that they have a different underlying stream.
This is exactly what we're trying to eliminate. We will also define a
generic connection handler object to reduce redundancy.
3 years ago
Sayan Nandan 7dadf4411f Persist artifacts across runs 3 years ago
Sayan Nandan 70d049e3f0 Enable rustup toolchain updates 3 years ago
Sayan Nandan 337ffbda81 Add testing for aarch64-apple-darwin 3 years ago
Sayan Nandan 9e11b8bcd0 Add note on how `dbtest` tests work 3 years ago
Sayan Nandan ee623586f9 Exclude port ranges reserved/blocked by Hyper-V
This commit removes the port ranges blocked/reserved by Windows on
Hyper-V VMs from the random port allocation range; see the comment for
more information.
3 years ago
Sayan Nandan 5f40e1538b Use IANA's dyn port range for setting random port 3 years ago
Sayan Nandan f151927f8a Add crt-static to RUSTFLAGS for Windows 3 years ago
Sayan Nandan 70ca5c143c Enable artifact generation on every commit 3 years ago
Sayan Nandan 7fb44e79c7
Merge 'flock' into next
Add native file locking
3 years ago
Sayan Nandan 2cbd35cbb5 Enable flocks on startup and shutdown
Several changes were made to accomodate for this, including the addition
of the write_to_disk function that should be used by fns which don't
have a FileLock to pass for flushing data to the disk.

BGSAVE now takes ownership of a FileLock object which it uses for
running BGSAVE.
3 years ago
Sayan Nandan fd23218809 Add test for Windows for duplicate unlock attempts 3 years ago
Sayan Nandan 02e57f5da0 Document `flock`s 3 years ago
Sayan Nandan 982b8e9a25 Use the unlocked field across all platforms
Initially added in 7777d1ee, this commit enables it for all platforms to
avoid an extra syscall
3 years ago
Sayan Nandan 7777d1ee96 Attempt to fix flocks on windows with unlock field
It seems that on Windows unlocking errors if the file has already been
unlocked. To fix this, we've added a platform-specific field to see if
the FileLock object has already been used to unlock the file.
This is the unlock field. In the Drop impl for Windows, we check the
unlocked flag to determine if we need to unlock the file.
3 years ago
Sayan Nandan 79a7cfd2c2 windows::um::fileapi::UnlockFile is an unsafe call 3 years ago
Sayan Nandan 8e45ef2427 Add test for flock that fails if lock is active 3 years ago
Sayan Nandan 46188f88db Fix missing import on Windows
As the linter doesn't show errors on non-Windows for the cfg(windows)
module, I happened to miss the std::fs::File import.
3 years ago
Sayan Nandan 6e680b33e5 Add native file locks for unix and windows systems
This commit implements file locks for unix-based systems and windows
systems. This is done by using platform-specific `__sys` modules for
locking, trying to lock and unlocking files.

A build script was added for unix-systems that make use of the
flock-posix.c file
3 years ago
Sayan Nandan aca9888109 Remove fscposix and begin adding native impls
This commit removes the fscposix.c file and begins implementing native
file locking mechanisms for each platform (supported platforms)

BSD-style `flock`s were added
3 years ago
Sayan Nandan bfb74200ec Use CoreDB::new_empty() instead of new for brevity 3 years ago
Sayan Nandan 8e41cab99a Re-compile fscposix.c if it changes 3 years ago
Sayan Nandan 2d7a03d279 Add basic test for file locks (POSIX) 3 years ago