Comments (19)
Toying around, I replaced the SharedMemoryManager
's _manager
attribute with multiprocessing.Manager()
and arrived at a different, possibly helpful error:
20:03.53 - DEBUG - Component botogram just loaded into the bot
20:03.55 - DEBUG - Component botogram just loaded into the bot
20:03.57 - INFO - The botogram runner is booting up.
20:03.57 - INFO - Press Ctrl+C to exit.
Traceback (most recent call last):
...
\runner\__init__.py", line 56, in run
self._shared_memory.start()
File "C:\.....\botogram\runner\shared.py", line 60, in start
self._manager.start()
File "C:\Python34\Lib\multiprocessing\managers.py", line 475, in start
assert self._state.value == State.INITIAL
AssertionError
Brad
from botogram.
Just a random note, I've figured out how to simulate the Windows behavior on my Linux machine, so it should be easier for me to simulate what's going wrong.
from botogram.
Toying around, I replaced the SharedMemoryManager 's _manager attribute with
multiprocessing.Manager() and arrived at a different, possibly helpful error:
No, that's because Manager()
automatically calls the start()
method, and obviously you can't start an already-started manager.
from botogram.
Ah, I see that now.
I've figured out how to simulate the Windows behavior on my Linux machine,
Very good, no doubt this will be more efficient than my actions. :)
from botogram.
I think I've found the problem (hopefully the only one).
When the runner's shared memory driver is serialized, it requires to the master process a new communication queue. Unfortunately, the master process starts accepting shared memory's commands after all processes are booted up. This doesn't cause any problem on Linux and OSX, but on Windows the driver object is serialized while booting up processes, so a deadlock happens.
Now I'm just tired, tomorrow I'll see how I can fix this problem (I wish this doesn't require a brand new process just for this thing).
Pietro.
from botogram.
Just a quick note, I've managed to get over the the deadlock. Unfortunately, a new error came out just now :-(
from botogram.
That's good news. I'm interested in seeing how you got around it.
from botogram.
I've pushed 10833fa, which doesn't bring full compatibility (there is the error I mentioned yesterday), but resolves the ones you reported I was able to reproduce. Can you try directly on Windows which errors it's giving?
from botogram.
Here it is:
05:08.19 - DEBUG - Component botogram just loaded into the bot
05:08.21 - INFO - The botogram runner is booting up.
05:08.21 - INFO - Press Ctrl+C to exit.
05:08.22 - DEBUG - Component botogram just loaded into the bot
05:08.24 - DEBUG - Component botogram just loaded into the bot
05:08.26 - DEBUG - Shared process is ready! (pid: 7048)
Traceback (most recent call last):
File "C:\Python34\Lib\multiprocessing\queues.py", line 242, in _feed
obj = ForkingPickler.dumps(obj)
File "C:\Python34\Lib\multiprocessing\reduction.py", line 50, in dumps
cls(buf, protocol).dump(obj)
File "C:\Python34\Lib\multiprocessing\queues.py", line 57, in __getstate__
context.assert_spawning(self)
File "C:\Python34\Lib\multiprocessing\context.py", line 347, in assert_spawning
' through inheritance' % type(obj).__name__
RuntimeError: Queue objects should only be shared between processes through inheritance
from botogram.
Perfect. Later in the afternoon I'll try to migrate from queues to pipes.
from botogram.
Current status: I can't find a way to transfer pipes to different processes via other pipes. Uff.
from botogram.
Hmm, seems to be a tough problem. I have set up the docker tool chain in order to further develop. Perhaps with time a solution to this process issue will present itself. Thank you for looking into it nonetheless.
Brad
from botogram.
Yesterday I started implementing the interprocess communication with standard sockets. If this doesn't work (but I think it will) I'll probably drop Windows suppory, since I'm wasting too much time on this, delaying new features.
from botogram.
Completely understandable. I'm looking forward to what else you come up with. Cheers.
from botogram.
Seems that the interprocess communication with sockets works fine. Now I'll start figuring out how to correctly use it with the multiprocessing's Managers, but I'm optimistic this time.
from botogram.
By the way, I'm a bit busy, but I'm still working on this :)
from botogram.
Hey @tsculpt, do you mind checking if the latest commit on the socket-ipc
branch is working?
Thanks,
Pietro.
from botogram.
A friend of mine tested the changes on Windows, and all works flawlessy!
from botogram.
Awesome work Pietro! I'm looking forward to release. Cheers.
from botogram.
Related Issues (20)
- Callbacks on Windows doesn't work HOT 1
- Lack of 'mime_type' field in Photo objects HOT 1
- Button callback won't work HOT 9
- Get User's username in a chat with Telegram Bot HOT 4
- Get User's Geo-based location in a chat with Telegram Bot HOT 2
- Inline keyboard in incoming Message objects HOT 4
- Fetch phone no from user HOT 2
- Add CSV as database for Telegram Bot HOT 1
- Check if a user is member of channel HOT 6
- Bot's reply to a chat message HOT 2
- Code running twice? HOT 2
- Buttons not working HOT 5
- [Docs] botogram.Message does not have `id` property HOT 1
- how does bot read a message with (text + photo) HOT 3
- Parsed_caption
- ConnectionResetError: [Errno 104] Connection reset by peer
- Can't use shared memory in callbacks.
- if "forward_from" attribute uses "chat" object, in case the channel message has the signature it doesn't return "channel"
- ForceReply doesn't work with the new attach argument
- Reliability HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botogram.